Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with insert
Message
From
24/10/2006 11:09:15
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
24/10/2006 10:33:52
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01164088
Message ID:
01164097
Views:
13
>Hi
>
>How I make to insert dataset in sqlserver 2005 database with vs 2003.
>
>Thank'u

Daniel,
        Dim myCon As New System.Data.SqlClient.SqlConnection
        myCon.ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer"

        Dim myCmd As New System.Data.SqlClient.SqlCommand
        With myCmd
            .Connection = myCon
            .CommandText = "INSERT INTO [Customers] (CompanyName) VALUES ('MyCompany')"
            .CommandType = CommandType.Text
        End With

        myCon.Open()
        If myCmd.ExecuteNonQuery() <> 1 Then
            ' An error occurred, do something
        End If
        myCon.Close()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform