• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Datasource ?

I have a Datasource that's bound to an SQL Server stored procedure. This sp needs to be passed a paramater. How would I have the DS pass it the paramater?
0
szx248
Asked:
szx248
1 Solution
 
Bob LearnedCommented:
Here is a sample:

  Dim conn As New SqlConnection(connectionString)
  Dim cmd As New SqlCommand("sp_getlist", conn)
  cmd.CommandType = CommandType.StoredProcedure
  cmd.Parameters.Add("ID", SqlDbType.Int).Value = id
  conn.Open()
  Dim reader As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)

Bob
0
 
szx248Author Commented:
>Dim conn As New SqlConnection(connectionString)

what is the connectionString? I am getting an error on this which I guess means that I have to set it. But how?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now