w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Need help updating many data tables: value shown when table is called after update is no the same as the value updated
Ressources about MVC 4 Caching : http://www.dotnet-tricks.com/Tutorial/mvc/4R5c050113-Understanding-Caching-in-Asp.Net-MVC-with-example.html In my app, which was strongly tied to the database (also mvc3), I needed that no page was cached at all, so instead of decorating every method, I changed the Global.asax.cs to add this : protected void Application_PreSendRequestHeaders(Object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); }

Categories : C#

Data is not updated into the database?
You should always used parametrized queries to avoid SQL injection vulnerabilities - and it's faster, too! To use parameters, write your SQL statement like this: string stmt = "Update adm SET qty = @Qty WHERE ID = @ID" and then use it like this: using (SqlCommand cmd = new SqlCommand(stmt, conn)) { cmd.Parameters.Add("@Qty", SqlDbType.Int).Value = 42; cmd.Parameters.Add("@ID", SqlDbType.Int).Value = 4711; conn.Open(); cmd.ExecuteNonQuery(); } More resources on using parametrized queries in ADO.NET: Shorten development time by using parameterized queries in ADO.NET Creating a Parameterized Query in ADO.NET Using Parameterized Query in ASP.NET

Categories : SQL

how to retrieve the updated data from the gridbox and update it in the database
That is probably because data is rebound before GridView1_RowUpdating is triggered. Try to change the Page_Load method like this: protected void Page_Load(object sender, EventArgs e) { // do not rebind the data on postback if (!IsPostBack) { obj = new DatabaseEntities(); GridView1.DataSource = obj.Records.ToList(); GridView1.DataBind(); } }

Categories : Asp Net

Updating records, getting successful message but data isn't being updated in database
You query is still failing, you are seeing "Updated data successfully" because it is outside of the if statement. Try this: if(!$retval){ //query has failed, produce error die('Could not update data: ' . mysql_error()); } else{ //query is successful echo "Updated data successfully "; mysql_close(); }

Categories : PHP

Identify blank tables in a database and insert data from another table on a different database
do you want an exact copy of the database? why not a backup of the main one and a restore with a different name? If not possible, you can use SSIS to move the data or something like: insert into destDB.dbo.mytable select * sourcedb.dbo.mytable you can use your script to loop through the empty tables and run some dynamic SQL to execute the command above

Categories : SQL

copy only tables with data from one database to another database
How about generating the database scripts like in the following artcles http://www.codeproject.com/Articles/598148/Generate-insert-statements-from and http://msdn.microsoft.com/en-us/library/ms186472(v=sql.105).aspx

Categories : Sql Server

Getting data from database tables
I don't think that the JSONArray object has a contains(JSONObject obj) function but you can make one yourself (See this link for an example). With this, inside of the for loop after you create each JSONObject check if your JSONArray contains the object. If not, add it, otherwise dont add it. This is not the most elegant solution but it should work.

Categories : Java

How to insert data in two different tables of two different database in php
Simply connect to 1 database, insert new row, disconnect, connect to the other database, insert row into that one and disconnect. Or you can use $connect1 and $connect2 to refer to each of them separately and do the insertion parallely. EDIT: Btw you can select the database with the 4'th parameter of mysql_connect, no need to use mysql_select_db And very important, you should write mysqli not mysql. Because mysql functions are not going to be supported for much longer.

Categories : PHP

Options in tables with data from database
You can call Delete.php using AJAX, so the request is executed without leaving the page. The advantage of making an actual link to the delete page, is that it also works without Ajax/Javascript. So you can start by building a plain delete page, and add the Ajax later.

Categories : PHP

Compare data between two tables with in single database
Assuming you both tables have the same structure Quick and dirty? ;WITH cte AS ( SELECT 1 AS OriginTable, * FROM OriginTable1 UNION SELECT 2 AS OriginTable, * FROM OriginTable2 ) SELECT {put here the list of all your columns} INTO [YourDeltaTable] FROM cte GROUP BY {put here the list of all your columns} HAVING COUNT(*) = 1

Categories : SQL

Comparing the data of two tables in the same database in sqlserver
Red Gate SQL Data Compare lets you map together two tables in the same database, provided the columns are compatible datatypes. You just put the same database in the source and target, then go to the Object Mapping tab, unmap the two tables, and map them together. Data Compare used to use UNION ALL, but it was filling up tempdb, which is what will happen if the table has a high row count. It does all the "joins" on local hard disk now using a data cache.

Categories : SQL

I can't delete all the data within 2 tables of a database which is in a relationship using Delphi7
After the Cascate delete sugestion I whent to research it and found a easier way here. All that basically have to happen is that the data from the secondary Table have to be deleted before those of the primary Table. procedure TfrmKomp.btnTerug1Click(Sender: TObject); begin frmData.qryVGKompetisieDB.Active := false; frmData.qryVGKompetisieDB.SQL.Text := 'Delete * from tblAntwoorde'; // delete from SecondaryTable frmData.qryVGKompetisieDB.ExecSQL; frmData.qryVGKompetisieDB.SQL.Text := 'Delete * from tblDeelnemers'; // delete from PrimaryTable frmData.qryVGKompetisieDB.ExecSQL; frmData.qryVGKompetisieDB.SQL.Text := 'SELECT * from tblDeelnemers'; // for displaying on dbgrid that records is removed frmData.qryVGKompetisieDB.Active := true; end; Tanks for all the help with y

Categories : SQL

database tables for each customer or database design with linked tables?
Read up on the database normalization and the reasons to at least get to 3rd normal form. In your exammple: CRM CRM.UniqueKey Products Product.UniqueKey customer_products (CP) CRM.UniqueKey -| combined make a composite unique key (unless you need to track history then you may want to Product.Unique Key -| add a start date ) CP.StartDate -| CP.EndDate -| Start and end dates allow customers to add remove products active ones would always have -| end date of null (but only do this if history is needed) Customer_products is an Associative table between two primary tables and resolves the many-to-many relationships between customer and products.

Categories : Mysql

Recursive function in R to find unique rows of a list of data tables
Add an id column to each data.table t1$id=1 t2$id=2 t3$id=3 then combine them all at once and do a unique using by=. If the data.tables are huge you could use setkey(...) to create an index on id before calling unique. tall=rbind(t1,t2,t3) tall[,unique(col1,col2),by=id]

Categories : R

SQLite: creating many tables vs. filtering one database for big sets of data
Use one large table instead of creating new tables. You never want to continuously create new tables for every new chunk of data (in this case, folders). This would cause serious performance problems and result in an inflexible database design. Databases are faster than you expect. Your database probably won't be very large (because it is being stored on a phone), therefore you shouldn't have any difficulty performing simple queries in a short time.

Categories : Android

java- How to display data from 2 tables in Netbeans from ORACLE database
Problem is in your SQL Query; ResultSet rs1=select.executeQuery("select * from narocnik,prevoz"); If you want to join two tables you should use joining like inner join, left join, right join or outer join. But when you just use comma (,) in your query to join two tables it will be outer join. It will give you multiple result; User Inner Join like - Select * from table1 inner join table2 on table1.id = table2.id; Hope it will work for you.

Categories : Java

Joining tables in a database using differently formated data (MAC addresses)
Simple way to convert the values would be to split or tokenize the string on the :. Then loop over the items and if size != 2, prepend a 0, and then concatenate them back together. Kinda brute force, but it'd do the job.

Categories : SQL

How to combine data from several database tables into a single result table in SQL
What you want is probably an OUTER JOIN: SELECT Biodata.Nama, Biodata.Alamat, Telepon.telepon FROM Biodata RIGHT OUTER JOIN Telepon ON Biodata.IdBiodata=Telepon.IdBiodata

Categories : SQL

Trying to use query variable and form data to change tables in database
What if $_GET['id'] is not set? it will fail. Also please read up into correct usage of SQL in PHP. Your code is vulnerable to SQL injection attacks and whatnot. EDIT: updated piece of code if(isset$_GET['id'] && is_numeric($_GET['id'])) { $ware_number = $_GET['id']; Echo "<form action='usernamecheck.php?id=" . $_GET['id'] . "' method='post'>"; .....

Categories : PHP

I want to get updated records from web sql server database into local database table through Store Procedure
Check linked server. http://www.jensbits.com/2010/11/10/create-linked-server-sql-server-2008/ after link the web server in to your local server, can access data easily.

Categories : Sql Server

Database Design : Is it a good idea to combine two tables with the same columns and too many data?
The main question you should be asking is - how am I querying the tables. If there is no real logical connection between the 2 tables (you don't want to get the rows in the same query) - use 2 different tables, since the other why around you will need to hold another column to tell you what type of row you are working on, and that will slow you down and make your queries more complex In addition FKs might be a problem if the same column if a FK to 2 different places In addition (2nd) - locks might be an issue - if you work on one type you might block the other conclusion - 2 tables, not just for speed

Categories : Sql Server

Do transactions lock the tables updated
On the subject of maintaining counters I would recommend you investigate 'Autoincrement' because this solves the problem you are addressing. The limitation is that you cannot guarantee there are no gaps in the sequence. This is because of the answer to your second question. If transaction 'A' begins with a new counter value, Tran 'B' can follow with another before 'A' has committed - so yes - the table is accessible. If you try and manage counters yourself (perhaps to try and avoid gaps) you will have to cope with the possibility that tran 'C' comes along after 'A' has rolled back but before 'B' has committed - and you will have a duplicate. Using the AutoIncrement mechanism will guard against that, but the counter will have a gap left by Tran 'A'. Hopefully that is the issue you are

Categories : SQL

Upgrade pre-populated sqlite database tables without removing tables with user input?
The way I plan on distributing the database is via the following method for adding a pre-populated database to an app Using your own SQLite database in Android applications. That code has been out of date for some time. Please consider using something more modern and supported, like SQLiteAssetHelper. I want to completely replace those existing tables with the tables from the new pre-populated tables, yet leave the user populated tables intact SQLiteAssetHelper supports two patterns out of the box: Replace the entire database with the new packaged copy Run your own SQL scripts to update the existing installed database, ignoring the copy packaged with your app Since SQLiteAssetHelper is open source, you can see how Jeff Gilfelt wrote it and try to leverage that for somehow su

Categories : Android

The best way to organize search service, which can find data in a big database according to the set of filters
I think HBase we suit your requirement, and for .net compatibility, hadoop .net sdk is available from Horton : LINK for more information

Categories : Dotnet

Find the last time table was updated
If you're talking about last time the table was updated in terms of its structured has changed (new column added, column changed etc.) - use this query: SELECT name, [modify_date] FROM sys.tables If you're talking about DML operations (insert, update, delete), then you either need to persist what that DMV gives you on a regular basis, or you need to create triggers on all tables to record that "last modified" date - or check out features like Change Data Capture in SQL Server 2008 and newer.

Categories : Sql Server

Update tables in database from tables in a different form
You can use INSERT INTO ... SELECT construction. There is a nice manual from MySQL: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html For instance, INSERT INTO posts (post_title, description) SELECT Products.Name, Products.stock FROM Products This will insert to the posts table all names & stock levels of your products in a title and description columns P.S. I do not see any connection between Products and Product Description. Are there any foreign keys?

Categories : PHP

Data-centric application: separate database tables for separate organizations a good idea?
I was wondering whether rather than have a single set of tables, it would be much safer to have a separate set of tables for each client, all running within the same database. If you want to do this, you have a separate set of tables for each client, running in different logical databases. It's easier for the DBAs to manage. You're basically admitting that you can't depend on your application code to keep the firms separate when sharing the same database tables. Since each firm will have around 20-40 tables, will the number of tables tend to explode in magnitude with number of users, thus slowing down the database altogether? You're either going to have 20 - 40 tables for each firm, or 20 - 40 large tables for all the firms. The amount of storage will be about the same either

Categories : Database

how datatable can be updated to database in vb.net
dataAdapter.UpdateCommand = commandBuilder.GetUpdateCommand() table = Me.bindingSource.DataSource table.AcceptChanges() Me.dataAdapter.Update(table) In this way we can update datatable to database

Categories : Database

Database doesn't get updated
Your Where clause is using Age so, if you edit the age then where cause couldn't find anything. And just like what JasonMcCreay Said, mysql_* is deprecated. Try to search for PDO or mysqli_*.

Categories : PHP

SQLite 3 database is not updated
You've to call conn.commit() before conn.close(). If you want autocommit mode you've to put isolation_level=None as argument for db.connect() call.

Categories : Python

Make 'collectstatic' find updated files
UPDATE: Disclaimer - This issue has to do with external hosting on Amazon's S3 Storage I had simply forgot to include AWS_PRELOAD_METADATA = True in my settings.py file. Adding this setting in fixed the issue of collectstatic only finding new files. Also, I saw a major speed increase in syncing between the server and Amazon's S3. If you are using S3 for storage, I found this answer to be quite helpful.

Categories : Django

Why is this field not being updated in the SQLLite database?
Looks like you are reading same values for both _url and _remoteHomeDir from the edittext siteManHome. This can be a mistake and may be you have separate edit texts in the GUi That is: _url = siteManHome.getText().toString(); _remoteHomeDir = siteManHome.getText().toString(); Maybe you meant to get _remoteHomeDir from a different field?

Categories : Java

Returning only updated fields from database
You could use @DevN00B's suggestion to identify modified rows, then use a CASE for each column to either return the new value or NULL The UPDATE performed by the owner would set the ModifyDate to GETDATE() for the existing record and insert the changed record with a NULL ModifyDate The GET procedure would then look something like the following SELECT CASE WHEN New.Name = Old.Name THEN NULL ELSE New.Name END CASE WHEN New.Category = Old.Category THEN NULL ELSE New.Category END ... FROM Product Old JOIN Product New ON Old.ProductID = New.ProductID AND Old.ModifyDate IS NOT NULL AND New.ModifyDate IS NULL Multiple UPDATEs will make things more complex, as you will have a row for each change, which in general won't have all the columns changed by all the seperate changes

Categories : SQL

When the database is updated the program freezes
What do you mean you cannot find a way to achieve this in the background? That's quite simple and you can do it in a number of different ways. NSOperation Grand Central Dispatch Core Data new iOS 5 API A simple example could be the following (GCD) dispatch_async(backgroundQueue, ^{ // create a new context for background execution and assign it the persistent coordinator grabbed form the main context NSManagedObjectContext *backgroundContext = [[NSManagedObjectContext alloc] init]; backgroundContext.persistentStoreCoordinator = persistentStoreCoordinator; // do your stuff here NSError *error; if (![backgroundContext save:&error]) { // handle error if necessary } }); where backgroundQueue is a queue that belongs to GCD grabbed like dispatch_queue_

Categories : Iphone

How can i edited in the datagridview as well updated the DataBase in C#.NET
After updating first row you update datagridview1 with original data m.Load_Table1(dataGridView1) Then next rows was updated with same values... Try to put Load method outside of foreach loop: foreach (DataGridViewRow row in dataGridView1.Rows) { //your update code for row... } m.Load_Table1(dataGridView1); m.Load_Table1(dataGridView4);

Categories : C#

how we can find out an calender event edited or updated on basis of their id
As far as I know you can only get a URI to the change content (onChange(boolean selfChange, Uri uri)), if it's known. Maybe one of these posts will get you further: Android: How to get event and calendar id from Observer/Receiver for CalendarContract.EVENT removal What is the best way to handle updates when the calendar syncs new events?

Categories : Android

To find the last updated record of each month for each policy(another field)
The main difficulty, is that the group by needs to be made both the conbination of policy_no, but also the month (extracted from the date). For example: In Mysql SELECT policy_no, month(eff_date), year(eff_date), max(eff_date) FROM myTable GROUP BY policy_no, month(eff_date), year(eff_date); Update I saw derived tables are allowed in teradata. Using a join to a derived table, here is how to access the full rows: select * from a, (SELECT policy_no, month(eff_date), year(eff_date), max(eff_date) as MaxMonthDate FROM a GROUP BY policy_no, month(eff_date), year(eff_date) ) as b where a.policy_no = b.policy_no and a.eff_date = b.MaxMonthDate; http://www.sqlfiddle.com/#!2/1f728/5 Update (Using Extract)

Categories : SQL

Mysql Num Rows Error, but Database is Updated
mysql_num_rows() is the wrong function here because what is does Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set. To see how many rows were changed, use mysql_affected_rows(). $num_rows = mysql_affected_rows(); Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.

Categories : PHP

session.Query is not getting the updated record from database
Nhibernate session is a static initializer. Sometimes session is not able to refresh values. So You have to flush and clear the session session.flush(); session.clear();

Categories : C#

Database not updated using repository pattern and EF Code First
Since no other solution came by I decided to change my approach. I've first created the database myself and made sure the correct SQL user was configured and I had access. Then I removed the initializer and the code from the Global.asax file. After that I ran the following command in the Package Manager Console (since the layered design I had to select the correct project in the console); Enable-Migrations After the migrations where enabled and I made some last minute changes to my entities I ran the command below to scaffold an new migration; Add-Migration AddSortOrder After my migrations were created I ran the following command in the console and voila, the database was updated with my entities; Update-Database -Verbose To be able to seed the database when running the migratio

Categories : Asp Net Mvc



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