|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, July 22, 2007 10:41 PM
Points: 2,
Visits: 1
|
|
Hi everybody, i swear someone can help me here i'm trying to call stored procedure......here is my code ' Connect to the data source using the Open' method of an ADODB.Connection object..Dim con As New ADODB.Connectioncon.Open( "provider = .NET Framework Data Provider for SQL Server")con.string = "productid.mdf;Initial Catalog=Product;Integrated Security=True;Pooling=False;uid=uid;pwd=pwd "' Create an ADODB.Command object that uses the' connection object "con", and calls the stored' procedure named "proc1"..Dim cmd As New ADODB.Commandcmd.ActiveConnection = con cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "insertcustomer"' Call the stored procedure..cmd.Execute() ' Disconnect from the data source..con.Close() End Suband i have an error when i run it they error is "Provider cannot be found. It may not be properly installed." anyone here have isssue how to resolve this bug Thanks you
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, October 22, 2007 1:18 AM
Points: 53,
Visits: 4
|
|
The correct driver name is "Provider = SQLNCLI" for dot net native driver for sql server.
Instead of using connection string, put directly in the open() method.
con.Open("Provider = SQLNCLI;Data Source = myserver; Database=mydb;", "user", "password")
Please use this and let me know if you have a problem ... Thanks.
FP
FP
True Love is Like A Ghost. Everyone Talks About It & Nobody have seen it.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, July 22, 2007 10:41 PM
Points: 2,
Visits: 1
|
|
thanks grooshopper but i resolve my probleme here my code is now Dim sqlcon As New SqlClient.SqlConnectionsqlcon.ConnectionString = "Data Source=WISEMAN\SQLEXPRESS;Initial Catalog=Productdetail;Integrated Security=True;Pooling=False;uid=uid;pwd=pwd "Dim cmd As New SqlClient.SqlCommandcmd.Connection = sqlcon cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "insertcustomer"cmd.Parameters.AddWithValue( "@detail", TextBox2.Text)sqlcon.Open() cmd.ExecuteScalar() sqlcon.Close() and now it work fine for my delete,update,and insert Procedure thanks you for the help
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, October 22, 2007 1:18 AM
Points: 53,
Visits: 4
|
|
Thanks. Happy SQL-ing =)
FP
True Love is Like A Ghost. Everyone Talks About It & Nobody have seen it.
|
|
|
|