w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
app has stopped when adding adapter
As per your code (snippet below), it seems that activity_main has a pager component in it. However, the layout file that you have shared does not have it. Now, since you are looking for R.id.listview in same layout file as that contained R.id.pager, obviously, there is something wrong. So, I am assuming that your expectation that there is a component R.id.listview present in layout is wrong, and hence you are getting null pointer exception setContentView(R.layout.activity_main); //Pager settings ViewPager pager = (ViewPager)findViewById(R.id.pager); .... ListView listView = ( ListView ) findViewById(R.id.listview); //this is null

Categories : Java

Database error in ListView: app has stopped
In onPostExecute() you create an adapter which gets candidatosList as data. The SimpleAdapter now expects that this data is only changed if notifyDataSetChanged() is called immediately afterwards (change and call should happen on main thread only). In onFinish() of your timer you call candidatosList.clear() (onFinish() runs on the main thread so this is ok) but you do not call notifyDataSetChanged(). Better approach: Don't call candidatosList.clear() at all, instead create a new ArrayList (e.g. called "temp") at begin of monitorizar(), fill it with received data and as last step of monitorizar() set candidatosList = temp. To make this work under all circumstances, candidatosList should be declared volatile (because it is used by multiple threads).

Categories : Android

PHP has stopped implicitly detecting MySQL database links
Calling mysql_query() without a connection parameter will use the most recently established connection. So as long as you're only connecting to one database, you won't see any problems. From the docs: If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated. If you add or include some new code that's connecting to a different database though - perhaps a hit tracker, or an analytics tool, for example - then that can break your existing code because it establishes another mysql connection - and any of your queries that happen after that new connection is established wi

Categories : PHP

My codeigniter site stopped outputting data from my database
Change this line in your site controller function home: From this: $data["results"] = $this->model_get->getData("home"); Into this: $data["results"] = $this->model_get->getData("home page"); I know this because you took this from the youtube tutorial of Steven.

Categories : Database

Reading data from file and adding it to database without adding the same values
if (!isPatent(connection, preparedstatement, name)) addpatient(connection, preparedstatement, name, age, height, weight); public static boolean isPatient(Connection connection, PreparedStatement preparedstatement, String name) throws SQLException { boolean exists = false; preparedstatement = connection .prepareStatement("select * from allpatients where name = ?"); preparedstatement.setString(1, name); ResultSet rs = preparedstatement.executeQuery(); if (rs.next()) { exists = true; } rs.close(); return exists; }

Categories : Java

table not adding to database
actually your variables looks wrong. try this $image = $_POST['Image URL']; $link = $_POST['Link']; $price = $_POST['Price']; EDIT. you should add value="something" to your inputs <input type="text" value="" name="title" placeholder="Title" /><br /><br /> <textarea rows="15" cols="50" value="" placeholder="Content" name="content"></textarea><br /><br /> EDIT:2 give a name to the submit button <input type="submit" name="submit" value="Add Article" />

Categories : PHP

Adding NULL in database
Address ad2=new Address(); ad1.setCity("Pune"); You are setting the city pune to address1,instead of address2 try changing it as Address ad2=new Address(); ad2.setCity("Pune"); UPDATE Your user table adrees column is null because there is no mapped field in your pojo for address anyways your way of database schema design is wrong implementing onetomany relationship. Please check here One to Many Hibernate for proper way

Categories : Java

Adding data from a DataTable to a SQL database
The meaning of your error is : The destination table with name return by Aapi_ReportData.TableName does not exist in your destination database. if your source and destination table has same schema you do not need to use s.ColumnMappings.Add

Categories : C#

Adding to database SQlite Python
Your syntax isn't correct. You need to add values to your query, and because you're not providing data for all columns, you need to specify which: import sqlite3 c = sqlite3.connect(':memory:') c.execute("create table mytable (_id integer primary key, a, b)") c.execute("insert into mytable (a,b) values (?, ?)", (2,3)) c.execute('select * from mytable').fetchall() # [(1,2,3)]

Categories : Python

Adding to database without refreshing the page?
index.html.erb needs the @tracks variable. Therefore, you have to set it before rendering the page. For example: def create @track = Track.create(params[:track]) @tracks = Track.all render :action => "index" end

Categories : Ruby On Rails

Adding information from variables to database PHP
Replace echo $row2['first_name']; with return $row2['first_name'];. If you want to get some value from the function, you should use return operator to pass the value back. It has nothing to do with printing the value with print or echo.

Categories : PHP

Adding a stored procedure to a database
A stored procedure is an object that belongs to one database exctly. When you add the SP, it will be added to the database you are currently using. To make sure you are running the current database, run this: Use [MyDatabase] GO

Categories : SQL

MVC4 : adding roles in database
What If I do something like this? [AllowAnonymous] public ActionResult Login(string returnUrl) { var _role = new CodeFirstRoleProvider();//remove after role is added to database _role.CreateRole("Admiin");//remove after role is added to database _role.CreateRole("NonAdmin");//remove after role is added to database ViewBag.ReturnUrl = returnUrl; return View(); } and once the roles are added to database i remove those code that does role adding.

Categories : Asp Net Mvc

Adding nested entities to a database
Instead of parsing into List<File> just insert into database at that step. Of course, you'll need to look to see if the genre exists, and if it does then insert files under that genre, if not then insert a new genre with the files already in the List<Album> Albums Since you can do all of this in one context, entity will be very efficient for you. What I mean is that entity will track whether things are in the database or not and you can just build the tree of genres and albums and call one save changes.

Categories : Asp Net Mvc

Save data instead of adding to database
I'm afraid you'll need to get article again from database, update it and save changes. Entity framework automatically tracks changes to entites so in your repository should be: public void EditArticle(Item article) { var dbArticle = entities.items.FirstOrDefault(x => x.Id == article.Id); dbArticle.item_title = article.item_title; //and so on //this is what you call at the end entities.SaveChanges(); }

Categories : Asp Net

adding translations to database records
You should take a look at the Globalize Gem: Github of globalize3 Gem This gem should do exactly what you need. ;) And if it doesn't, please, explain why by providing more details on what you want to do and I'll update my answer according to your needs.

Categories : Ruby On Rails

Adding value from html page on database
The answer in its simplistic form is to open a session, begin a transaction then commit. Something along the lines of:- public bool SaveData(...) { using (var session = Deneme.Config.FluentlyConfigure.SessionFactory.OpenSession()) { using (var tran = session.BeginTransaction()) { Address adress = new Address(); adress.City= City; ... session.Save(address); tran.commit(); } } return true; } It looks like you might need to refactor your FluentlyConfig class to expose the SessionFactory. You might want to look at sesion-per-request to help you for session management in NHibernate. Also I would check your AJAX POST as that does look right as well.

Categories : C#

Asp.Net MVC AutoMapper Adding Records to Database
I read this post: The case for two-way mapping in AutoMapper and realised it probably isn't a good idea anyway, and looping and retaining control over your domain/database, is best. Thanks, Mark

Categories : C#

Adding a searchable database of webpages from my website. What to use?
use mysql's select and a form html <form method="post"> Username: <input type="text" name="name"><br> <input type="submit" name="submit"> </form> mysql query after submit <?php if($_POST['submit']){ $con=mysqli_connect("example.com","peter","abc123","my_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM users WHERE name = '".$_POST['name']."'"); while($row = mysqli_fetch_array($result)) { echo '<a href="website.com/players/'.$_POST['name'].'"></a>'; echo "<br>"; } mysqli_close($con); } ?>

Categories : PHP

Database Design - Is redundancy better than adding more relationship?
In this case it's really NOT the same information. It's category_name, category_description, brand_name and brand_description. Creating a table to keep generic information about many things is a bad idea. When it comes to the discussion about (de)normalisation it's generally considered a better design to normalise data and I would start with such a design. As your data evolves and grows it might be necessary to de-normalise some tables as the data retrieval can be faster at the cost of storage space and risk of loosing data consistency.

Categories : Mysql

show jQuery Pop up after Adding User to Database
You could try removing the return false; line in the click function. That should allow you to submit the form on button click but you won't see your dialog message when the page refreshes. Alternatively you could use an ajax call to post your form. Something like this: $("#show-dialog").button().click(function () { $.post( 'your-route', $('form').serialize(), function(data) { $('#dialog').dialog('open'); }) });

Categories : Jquery

Adding a view to database created by Code First
When a change occurs in classes of context or in your database, when you are using EF code first, you need to run migrations commands. Take a look in this link :http://msdn.microsoft.com/en-us/data/jj591621.aspx

Categories : Asp Net Mvc

Adding connection to SQL Server : Can't select a database name
In the folder C:WindowsMicrosoft.NETFramework64v4.0.30319Config (should see for other versions as well), open the file machine.config and then see if the tag was duplicated. If it's duplicated then, delete the duplicated tag in all machine.config of all .net versions.

Categories : Visual Studio 2012

Edit AutoCAD database, adding new tables
I use this for my classes. I recommend following this site too: http://adndevblog.typepad.com/autocad/2012/05/how-can-i-store-my-custom-information-in-a-dwg-file.html

Categories : C#

Add Date/Time when adding product to database
This can just be part of your database architecture: ALTER TABLE `products` ADD `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP This will automatically add a timestamp to the column created whenever a row is created. For more information, try this: Automatic Initialization and Updating for TIMESTAMP Obviously, in this case the table is called products and you would need to change it to whatever your table name is. UPDATE To update all existing records at the same time, just run: UPDATE `products` SET `created` = NOW() If you want to be more specific use: UPDATE `products` SET `created` = NOW() WHERE `created` = '0000-00-00 00:00:00'

Categories : PHP

PHP script not adding rows in MySQL database
Below is my original answer, which spawned the thread that led to the answer. Since this won't help many people looking for a solution, this will make things clearer: At the top of the form, after it has been displayed but before it has been submitted, add this code: $super_test = ( isset($_POST['f_name']) && !empty($_POST['f_name']) && isset($_POST['l_name']) && !empty($_POST['l_name']) && isset($_POST['reg_email']) && !empty($_POST['reg_email']) && isset($_POST['conf_email']) && !empty($_POST['conf_email']) && isset($_POST['password']) && !empty($_POST['password']) && $_POST['birthday-day'] != 0 && $_POST['birthday-month'] != 0 &&am

Categories : PHP

Display record in datagridview after adding to database
The code you've shown will successfully add a record to the database, but it doesn't make any attempt to refresh anything in the UI. Where is the code which binds the grid to records in the database? That code needs to be run again after this code runs. I'm assuming that code exists in some sort of initializer for the form. Perhaps some sort of load event? You'll want to move that grid-binding code into its own function and call it from both the load event and at the end of this click event, probably right after the line where you commit the transaction.

Categories : SQL

How to prevent adding identical records to SQL database
You could use UNIQUE column constraint or to declare a multiple columns unique constraint you can use UNIQUE () ON CONFLICT : CREATE TABLE name ( id int , UNIQUE (col_name1 type , col_name2 type) ON CONFLICT IGNORE ) SQLite has two ways of expressing uniqueness constraints: PRIMARY KEY and UNIQUE. Both of them create an index and so the lookup happens through the created index.

Categories : SQL

Getting a GET error when adding a google map from database values
Went a different route on this. This works well. <?php wp_reset_postdata(); $args = array( 'post_type' => 'artists', 'posts_per_page' => -1 ); $query = new WP_Query($args); ?> <script> var infowindow; var gmarkers = []; var side_bar_html = ""; (function () { google.maps.Map.prototype.markers = new Array(); google.maps.Map.prototype.addMarker = function(marker) { this.markers[this.markers.length] = marker; }; google.maps.Map.prototype.getMarkers = function() { return this.markers }; google.maps.Map.prototype.clearMarkers = function() { if(infowindow) { infowindow.close(); } for(var i=0; i<this.markers.length; i++){ this.markers[i].set_map(null)

Categories : Jquery

How to create a function for adding records to database
Generally speaking you should avoid weakly typed approach like this to achieve 'pseudo-decoupling'. I would definitely use a business object in this case which contains those four fields you populate the DataRow with. As long as your View code works directly with DAL it is nearly impossible to achieve high level of decoupling but anyway, working with business object in this case is much more error prone and type safe. Agree that while passing a Hashtable of Object values to populate a table you must be aware of data types each column represent therefore you can't pass arbitrary values to arbitrary table with single generic method assuming that they will match. Maybe you should also consider to implement a simple MVC (Model View Controller) pattern in order to really decouple the GUI from

Categories : C#

Change values row from mysql database instead of adding
something like below would help. var query = (from u in entities.users where u.user_id== UID select u).First(); query.Address = u.Address; query.Company = u.Company; query.Fax = u.Fax; query.Mobile = u.Mobile; query.Name = u.Name; query.Telephone = u.Telephone; entites.SubmitChanges();

Categories : C#

Adding image to android SQLite Database
change from this: private ContentValues createContentValues(byte[] Image) { ContentValues values = new ContentValues(); values.put(KEY_IMAGE, Image); return values; } public long addImage(byte[] image){ ContentValues cv = createContentValues(image); return mDb.insert(DATABASE_TABLE, null, cv); }

Categories : Android

Adding columns to database table dynamically?
"Another unrelated problem I have is: the data in the table affects directly a calculation, if any column is added, the calculation must consider the new column/columns." What you meant to say was "Another completely related problem is ...". Because this statement highlights the profound implications of your proposed implementation. Dynamically adding a column is the easy bit. The difficult bit is the concomitant need to conduct an impact analysis of the code base and assess all the SQL which references that table. After all, it is not enough to include the new column in that calculation. There may be other SELECTs which need to be amended (e,g, reports). And of course you need to get data into the new column, so that means amending UPDATE and INSERT statements. This sor

Categories : Java

Adding new record in a related table in database
Add the following line before db.SaveChanges(); db.TECHNICAL_SKILLS_VALUES.Add(dbSkill); OR db.AddToTECHNICAL_SKILLS_VALUES(dbSkill);

Categories : C#

Adding a required column to a database table
If what you mean by required is NOT NULL then it will set the column to whatever the column DEFAULT value is set to for all 3000 records. If what you mean is a PRIMARY KEY which by default is UNIQUE, then you would have to provide a value for all 3000 records or you could just set the column to AUTO INCREMENT and it will generate values

Categories : PHP

Adding existing users from a table to a membership database
It does actually store passwords. You probably have it configured for ‘hashed’ passwords – so you can’t actually see the passwords in the table – only a 1 way hash of the passwords. If you set the passwordFormat to Clear, the passwords will be in plain text within the db. That being said, for security I do suggest you use Hashed. Do a search on google on how to hash your existing passwords so they can be put in the db in the correct format. But if you want to get it up and running quickly, use Clear and then Hash them in the future once you’ve got everything working. And just a note - the password field is on the aspnet_Membership table.

Categories : Sharepoint

Adding an image to a responsive website that sends it to an SQL database
Make your camera icon an input that looks like this: <input type="file" accept="image/*" capture="camera"> This will launch the camera app in iphone iOS 6+ and android 3.0+. There is a javascript API for navigator.getUserMedia(). This works in Chrome, Firefox and will work in IE 11. See HTML5 Rocks: Tutorials: Capturing Audio & Video in HTML5 for details.

Categories : HTML

Adding post id inside a wordpress database query?
I am not sure if I understand you correctly, but here what I think First the_ID(); is used to displays the ID of the current post within the loop, it does not returns the value of the post id. To get the post id use: get_the_ID(). Second, if you are outside the loop, then neither simply the_ID() nor get_the_ID() is going to work, you have to provide the post id manually or by receiving it using GET or POST method.

Categories : PHP

Adding a String[] to a mySQL database as one id/column entry
I'd go with the answer you provided. Otherwise you could create a new table that simulates something like that: CREATE TABLE MYARRAY ( fkRowToReference int, value text, ordinal int ) With something like above each array entry would be a row in another table that references which original row it is attached to, and the ordinal would indicate its position. INSERT INTO MYARRAY(1, 'that', 0); INSERT INTO MYARRAY(1, 'this', 1); INSERT INTO MYARRAY(1, 'thing', 2);

Categories : Mysql

adding fields to database without changing views mvc4
If you are prepared to change your model class then you can use Html.DisplayForModel (for read-only views) or Html.EditorForModel (for editable views), which will auto-generate HTML on the basis of the properties of your model.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.