Sample code for inserting data into SQL Server database in VB.NET???

Sample code for inserting data into SQL Server database in VB.NET???

Post by Jay She » Sat, 22 Jun 2002 16:23:06



Thanks a lot.
What is the best way to insert data into Sql Server database???

Jay

 
 
 

Sample code for inserting data into SQL Server database in VB.NET???

Post by Frans Boum » Tue, 25 Jun 2002 17:21:28



Quote:> Thanks a lot.
> What is the best way to insert data into Sql Server database???

        Via a stored procedure, called by a SqlCommand object.

        If you want sample code how to do this, get my data-access tier
        generator LLBLGen from: http://www.sd.nl/software
        and generate a data-access tier for your database. Examine the
        generated code (T-SQL stored procedures and VB.NET classes)
        so you 'll have an idea how to do this :)

                FB

--
=======  You can't sell what's free  ====================================

Get my free, open source .NET software at   :  http://www.sd.nl/software
=========================================================================

 
 
 

Sample code for inserting data into SQL Server database in VB.NET???

Post by Ken Robison[M » Wed, 26 Jun 2002 00:27:24


Hi,

In most cases to insert data into Sql Server database you do so using a
stored procedure called by a SqlCommand object.
In other cases this may not be possible i.e. you don't have rights to
create or maintain the stored procedures etc.

The following articles provide information on the subject and should help
you make the appropriate choice for your situation:

Q313483 INFO: Roadmap for ADO.NET DataAdapter Objects
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q313483

ADO.NET: Update a Database from a DataSet
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/UpdateDataF...
spx

Q308055 HOW TO: Update SQL Server Database w/SqlDataAdapter in VB .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q308055

Q301248 HOW TO: Update a Database from a DataSet Object Using VB .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q301248

Q310350 HOWTO: Update Parent-Child Data w/Identity Column
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q310350

I hope this helps.

Ken Robison, MCSD

Want to know more? Check out the MSDN at HTTP://msdn.microsoft.com or the
Microsoft Knowledge Base at support.microsoft.com
Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
This posting is provided "AS IS", with no warranties, and confers no rights.