sql_string = ("Data Source=000.000.000.000;Initial Catalog=GCERP_SEC;User Id=sa;Password=kamikami;"); SqlConnection conn = new SqlConnection(sql_string); SqlCommand command = new SqlCommand(str_querry, conn); conn.Open(); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@string1" ,SecurityModule.userName_AD); command.Parameters.AddWithValue("@string2", SecurityModule.moduleid); // SqlDataReader rdr =StoredProcedureCommand.ExecuteReader(); SqlDataReader rdr = command.ExecuteReader(); if (rdr.HasRows) { StringBuilder sb = new StringBuilder(); string a; while (rdr.Read()) { sb.Append(((int)rdr["fnid_int"]).ToString()); sb.Append("\n"); a = sb.ToString(); function_name(a); sb.Length = 0; } } else { MessageBox.Show("not found"); } rdr.Close(); command.ExecuteNonQuery(); count++; conn.Close(); conn.Dispose(); } catch (Exception) { MessageBox.Show("Error in database connection"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)