DataSource Controls :: Using Dataadapter For Custom Add / Delete Of Database Table
Feb 12, 2010
My code is not updating the sql database. I am definately passing the correct information in to this function, and it runs without errors. If I exec the procedure with the passed in data, it works great. Can someone tell me what is missing?
I've have to delete multiple rows from database in a table . Which is the best way to delete data to optimize performance of sql server as well as asp.net.
Colour(Colour ID, Colour) DogColours(ColourID, Dog ID) Dog(Dog ID, Breed)
Colour ID and Dog are primary keys.
I have three web forms, one for each table. Dog colours consists of data that is already in the system from the other two tables. It basically joins a breed to a colour. My problem is this:
When i try delete a dog which is being used in dog colours the program crashes. How can i prevent this crash?
The second problem, the data source in the dog colours web form has the insert, update and delete tick boxes greyed out in the 'configure the select statement' so i am unable to delete a colour and dog joined together. how can i delete something in the dog colours?
How do I remove duplicate rows from a data table based upon a two column values;I want to pass in a Data Table and a column names and get the data table back with data rows where that columns value are unique.
I have a Data Table with Duplicate Rows i want to delete the duplicates rows based upon two column values if both columns values are there then Delete the row.
1. As per my knowledge we use dataadapters/dataset when we want to deal with the huge amount of column/data. Is there anyway that if I want to update one or two columns in a table without using dataadapter/dataset?
2. There is a way that without clicking a button we can get the data using objectdatasource, I mean to say that there is no vb.net data in the code behind then how to debug if there is not data in vb.net in code behind.
as you can see I'm a table adapter but is giving me the following error: i realy dont know what this error means - though i did a simular action using access DB (and it did work), where i had to user the following: using System.Data.OleDb; now because im using SQL DB im using: using System.Data.SqlClient; //sql server
Out of this 10 rows 3 Rows have their RowState as Added, 2 rows as Modified, and 4 as Deleted.
Now i want to use Datadapter's InsertCommand, UpdateCommand and DeleteCommand
Is it possible to update datatable's changes to Database with Single DataAdpater.Update(DataTable) Call.
Means i will call DataAdapter.Update(DataTable) method only once and with this all new added rows should be inserted in database, modified rows should be updated and deleted rows should be deleted from Database.
Im trying to do the batchinsert (bulk) in sqldataadapter using dataset.but somehow its not inserting (even no error as well), i dunno where i went wrong.my coding..
I have two tables dept and employees those table have parent and child relation ship link column is deptno i want to delte department even this departmetn contains employees i want to write storedprocedure for first delte employees and after department if i wrtie these two querys in storedprocedure will i get any problems
Begin Delete from tbl_employees where Department_Id=@Department_Id Delete from tbl_Department where Department_Id=@Department_Id RETURN END
I have 3 pages, one to add a category, one to edit the category, and one to delete the category. The add and edit work fine. The delete is not working for some reason. I click the link on my site to delete it, and I'm just staring at the green bar in my browser taking a long time. The add and edit don't take long at all to perform their function. I'm thinking this is a connection string issue, but I don't see how it can be the case. It relies on web.config for it just like the other pages. Following is the delete page code behind and also delete cascade from the business logic area. After the page refreshes, I'm not getting any diagnostics or error messages which I have in the code. Doesn't this have to mean a db connection issue?
when i want insert a record i see an error like this Can't perform Create, Update, or Delete operations on 'Table(MainMenuLink)' because it has no primary key. with this codes:
MyLinqDataClassesDataContext db = new MyLinqDataClassesDataContext(); MainMenuLink li = new MainMenuLink { Link = "www.tprogrammer.com", LinkSubject = "subject" }; db.MainMenuLinks.InsertOnSubmit(li); [code]....
I have a table in my aspnet database. I added a bottom row "Not Selected", if the user doesn't select from a databound drop down list. This row is at the bottom, because I just added it to the table data. Is there any way to move this one row to the top of the table manually? There is not "cut" and "paste" when I select the whole row.
I'm using the 'Configure Data Source' wizard to connect to my database and show the dataset in Gridview. I want to be able to update, insert and delete entries but am unsure how to build the query. I can write simple update statments to change database entries but how can I do this for entries that have been changed within the gridview?
i am trying to delete using Gridview from child first and check if there is no child to delete in parent table i am using sql datasource in the delete tab in sql datasource i put DELETE FROM table1 WHERE (IDtable = @IDtable) IF (SELECT count(*) FROM table1 WHERE parent_dtl_id = 66) =0 BEGIN delete from parent_dtl where order_dtl_id= 66 END
i deleted all items,deleting from 2 tables child and parent was successfully on the last row from gridview but i have this error on my page on the last delete Specified argument was out of the range of valid values. Parameter name: value