>That is a lot of work ... )-:
>
>
Yep. It is less than having to play with a dataadapter, but still a pain.
The ExecuteScalar (not execscalar as I wrote originally) at least gets the result fairly easily once the command is written.
Here's a real example..
Dim userID As String
Dim cmd As New SqlCommand
Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString
cmd.Connection = conn
cmd.CommandText = "select userid from aspnet_users where username=@username"
cmd.Parameters.Add("username", SqlDbType.VarChar)
cmd.Parameters("username").Value = Me.CreateUserWizard1.UserName.ToString.Trim
cmd.Connection.Open()
userID = cmd.ExecuteScalar().ToString()
cmd.Connection.Close()
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________