.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Deleting rows in the data source in ASP.NET?

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net

I used statements like 'Update' and 'Insert Into' to change the data in my data source. Like I updated a certain field like this:

ds.Tables("tblUsers").Rows(2)(3) = "xyzzzz" 

and then I executed an sql statement on the same field like this: 

objCmd.UpdateCommand = new OleDbCommand

objCmd.UpdateCommand.CommandText = "Update tblUsers " & _

"SET City='xyzzzz' WHERE UserID=3"  

objCmd.UpdateCommand.Connection = Conn

And finally I update the data source:


(where objcmd is an instance of oledbdataadapter object)


What should I do to delete a record in my data source through asp.net (in VB) with the same technique as above? The data source that I am using is MS Access. Please, help. 

View Complete Post

More Related Resource Links

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Toolbox: Data Snapshots, Subversion, Source Code Organization and More


If you want to save, organize, and annotate snapshots of your database data, find an easy way to install and configure Subversion, and automate the organization of your source code, then you'll want to read more about these latest tools.

Scott Mitchell

MSDN Magazine August 2009

Data Points: Data Source Controls in ASP.NET 2.0


ASP. NET 2. 0 introduces a series of new tools that improve data access including several data source and data bound controls. The new assortment of data source controls can eliminate a ton of repetitive code that was required in ASP.

John Papa

MSDN Magazine January 2005

Empty Website Data Source windown


Hi all,

I am Visual Web Developer user and facing a problem when I am creating a local report (.rdlc) file.

I am using Business objects as the Data Source for this report. It was working perfectly until all the items in the Website Data Source window suddenly "disappeared". The "Add New Data Source" button on this window is also disabled. Now the window is just like a blank box only. And I can't continue working with the report file like this...

I have tried undoing what I did before but it does not help at all...

Any reason for this to happen? There is no sign or something at least indicating what is wrong.

Please help.


 ps: found a similar thread in this forum but not solved

The report cannot be opened because the data source associated with it is not a report model.


i tried to open a report i created in sql business intelligence development studio in the report builder in wss3 and it gave me this error:

Microsoft.ReportingServices.ReportBuilder.ReportModel.Report: The report 'http://servername:port#/Reports/report.rdl' cannot be opened because the data source 'http://servername:port#/DataSource Library/datasource.rsds' associated with it is not a report model.

This report was not created in Report Builder. Try opening this report in Report Designer instead.

can i fix this so i can open my reports in report builder?


BDC Entity as a Data Source for a Lookup column

Is it possible to create a custom lookup field type to have a BDC entity as the data source?

GridView editing without using data source controls?


I am binding my gridview without using a datasource control and instead doing it in the code behind. However, I would like to use the inline editing features of the gridview. Could someone please point me to an example that does gridview editing/updating 'manually' in the code behind?


Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

Learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010 to read and write data to the AdventureWorks sample database.

Sample: Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

Explore the code in this visual how-to article as you learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010.

Join 2 flat file data flows - retain unmatched rows

I have two data flows from two separate flat files. They may contain matching IDs (account number), in this case specific data from each flow should be used to create one row. When there is no match, the rows would stand on their own. At the end of the flow, I need both flows combined into one flow, with one record for each key record (account number). If I were able to use a look-up, I could easily union the no-match data flow back into the match data flow and have the desired result. I cannot use a look-up, since the source is flat files, but this is exactly the functionality I am trying to achieve. Solutions I want to avoid: staging tables, and cache transformations. Any ideas are appreciated.

XML Source (Data is not loading to Destination ,Package Runs sucessful)

Hi First I run execute SQL Task SELECT TOP(10) [Message],opportunity_Id  FROM SBP FOR XML PATH ('GS_Opportunity'), ROOT('GSOpportunities') That will make 10 different file into single file then i have assigned this output to variable and it will output as XML Now I put Data flow task ,in it I put XML task and in source i have put XML Data From Variable and I select XSD file location,now XML task is showing me different source table and i have selected appropriate destination table but when i run this package it will not transform data from source to destination,Can you suggest me what is the problem i try to put data viewer it is not transforming any data  while insted of if i select direct file location instead of variable it is running good    

MDW Disk Usage for Database Report Error - A data source has not been supplied for the data source D

Hello, On the MDW Disk Usage Collection Set report, I get the following error when I click on a database hyperlink. A data source has not been supplied for the data source DS_TraceEvents SQL profiler shows the following SQL statements are executed (I've replaced the database name with databaseX) 1. exec sp_executesql N'SELECT dtb.name AS [Name] FROM master.sys.databases AS dtb WHERE (dtb.name=@_msparam_0)',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'databaseX' this returns zero rows as databaseX does not exist on my MDW central server, but is a database on a target server (i.e. one that is being monitored and uploaded into the MDW central server). 2. USE [datatbaseX] this produces the following error: Msg 911, Level 16, State 1, Line 1 Database 'databaseX' does not exist. Make sure that the name is entered correctly. why is the report looking for the database on my server? thanks Jag Environment: MDW (Management Data Warehouse) on SQL 2008 R2  

VS 2010 and data source issues

I've been banging my head against the wall for the past 4 hours on this one and think I'm going to need a little help here. I must be missing something. I'm in VS 2010 on Windows 7. I've got a web project which has been going fine, but no matter what I do I can't get a data source to show up in the Data Source window. I've added a data source using Data > Add New Data Source, and the "wizard" appeared to complete successfully. I have a data source showing in my solution explorer, and if I open the .xsd file I see all my tables from a remote SQL 2005 database. I have a good data connection to the database server showing up in the Server Explorer window. But no matter what I do I cannot get anything to appear in the Data Sources window, which is greyed out (the commands at the top are grayed out and there's gray text in the middle of the window reading "There are no data sources to show for the selected project"). Under the main Data menu at the top of VS, the "Show Data Sources" and "Add New Data Source" commands are missing. I can sometimes get them to reappear if I restart Visual Studio or reboot the OS, but not consistently. I've been all over Google on this and have tried every suggested solution I can find, to no avail. Anybody have any ideas? Thanks.

Data Source View Gives incorrect Error--Different Data Type

Hi, I'm creating a report model (2008 R2).  I am trying to create a relationship between two tables.  One FKs to another--same name and type (tinyint) columns.  But the Data Source View editor doesn't allow this, giving the message "...source and destination column have different data types".  But the columns are the same types.  I ahd this once before  acouple of years ago and don't remember how I got around it. Does anyong have ideas?  

Data Source View

I followed this below procedure for create a DataSource View In Solution Explorer, right-click Data Source Views, and then click New Data Source View. On the Welcome to the Data Source View Wizard page, click Next. The Select a Data Source page appears. Under Relational data sources, the Adventure Works DW data source is selected. Click Next. On the Select Tables and Views page, you select tables and views from the list of objects that are available from the selected data source. You can filter this list to help you in selecting tables and views. ( My probelm comes in 4th step, I see my server name in Relational Data sources area, i click next to select Tables & Views but i dont see any list of tables in there..? What am i Missing? Today is my day one on SSAS...please HELP FM

mysql data source provider - mysql connector/net

Dear All, I having problem installing mysql connector/net 6.2.3 on my vsd 2010 because the installed went smoothly but when Im trying to use the mysql on data source provider, I cant see it on the list and when try to install/change the connector the visual studio integreation has an x mark meaning to say it was not installed on my vsd2010.  Thanks.

Menu Data Binding from XML source

Hi , I have the following complex XML structure. I need to bind the values to menu via Binding from the XML source <Editions>      <Edition Name="A">            <Products>                  <Product Name="1">                        <Platforms>                              <Platform Name="11">                                    <A1 Name="A"/>                                    <B1 Name="B"/>                                    <C1 Name="C"/>  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend