Dim conn As SqlConnection = DirectCast(DataBasics.DataSources("").CreateBlankDbConnection(), SqlConnection)
All that does internally is create a new SqlConnection object and set its connection string to the one used by the data source.
Sorry about the earlier post. Once I posted my response, it dawn on me what you had said. It was as simple as...
conn.Open()
cmd =
Thanks for the help!
I guess I need little more help. I have used the DataBasics.DataSources many times to execute stored procedures and it works great. In my case, I believe I need to get a SqlConnection object, so that I can execute the SqlCommandBuilder.DeriveParameters(cmd) to retrieve the stored procedure's parameters.
How do I get a valid SqlConnection object using the DataSources..ConnectionString information to be used in the following statement.
cmd = New SqlClient.SqlCommand("StoredProcedureName", >> SqlConnection Object << )
Thanks!
In this case you would just create your SQlConnection variable for testing. You can also exevute queries directly off of this as well:
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandTimeout = 60
SqlCommandBuilder.DeriveParameters(cmd)
prm.Value = datarow(prm.ParameterName)
How can I use Strataframe's connection layer to eliminate the SQL connection object (SQLConnection99) I am using now to retrieve the parameter names?
I am sure it's simple, but I'm not seeing it. As always, thanks for your expert help!