..... ..... ConnectDataBase conDB = new ConnectDataBase(); bool ok = false; ok = conDB.runQuery("sp_get_unit", txtvalue, "uom"); ..... ....
public bool runQuery( string sp_name, string txtvalue,string paramName) { int added = 0; SqlCommand cmdSeek = new SqlCommand(sp_name, _SqlConnection); cmdSeek.CommandType = CommandType.StoredProcedure; cmdSeek.Parameters.AddWithValue(@paramName, txtvalue); try { _SqlConnection.Open(); added = cmdSeek.ExecuteNonQuery(); //rdr = cmdSeek.ExecuteReader(); _SqlConnection.Close(); if (added > 0) return true; else return false; //MessageBox.Show(rdr.ToString()); } catch (Exception err) { MessageBox.Show(err.Message, "ERROR : Invalid/Duplicate/Incomplete data!"); return false; } finally { _SqlConnection.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)