Author: maximusmd | Posted on: 11/16/2010 6:13:37 PM | Views : 911

Hi all:
I am trying to complete my function below but got lost in the different methods out there. It will always return 1 row and I
need to get the values of the record and ADD into a new row. The function returns a DataTable.
private DataTable CreateNewDataRow(DataTable dt, string instanceID) { string query = "dbo.GetJobHistoryById"; SqlConnection myConnection = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnString1"].ConnectionString); try { myConnection.Open(); SqlCommand cmd = new SqlCommand(query, myConnection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@instanceID", SqlDbType.VarChar)); cmd.Parameters["@instanceID"].Value = System.Convert.ToString(instanceID); //WHAT GOES here for fastest access?; Use ExecuteNonQuery(), DataReader(), etc //I need to access the results ...

Go to the complete details ...