This is kind of a two part question. I'm trying to make a very simple automated program that will run two stored procedures (one that updates, one that displays the new results) and then copies the results to the clipboard and pastes it in a new e-mail. I already have the e-mail generating and grabbing whatever is on the clipboard, but I need help with the store procedures.
Every guide I look at on Google seems to show a slightly different way of working with SQL, but I threw this together and need to know if it's working. I don't get any errors and the program "hangs" about as long as it takes for the actualy SP to run, but how do I get the "rows affect" output into a textbox or something?
Code:Dim SQLCon As New SqlClient.SqlConnection Dim SQLCmd As New SqlCommand SQLCon.ConnectionString = "Data Source=server;Initial Catalog=DB;Integrated Security = True;" SQLCon.Open() SQLCmd = New SqlCommand("StandardNamesUpdate", SQLCon) SQLCmd.CommandType = CommandType.StoredProcedure SQLCmd.ExecuteNonQuery() SQLCon.Close()




Reply With Quote