alter proc [dbo].[addrmpbirth] @bday varchar(50), @bm varchar(50), @by varchar(50) as begin insert into Employee (EBirthday,EBirthMonth,EBirthyear) values (@bday,@bm,@by) end
public DataTable Executereadercommand() { con.Open(); com.Connection = con; SqlDataReader sdr = com.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(sdr); con.Close(); return dt; } public DataTable addbirthemp(string bd,string bm,string by) { com.CommandText = "addrmpbirth"; com.CommandType = CommandType.StoredProcedure; com.Parameters.Clear(); com.Parameters.AddWithValue("@bday",bd); com.Parameters.AddWithValue("@bm",bm); com.Parameters.AddWithValue("@by",by); DataTable dt= Executereadercommand(); return dt; }
com
com.ExecuteNonQuery();
public void addbirthemp(string connectionString, string bd, string bm, string by) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); SqlCommand com = new SqlCommand("addrmpbirth", connection); com.CommandType = CommandType.StoredProcedure; com.Parameters.Clear(); com.Parameters.AddWithValue("@bday",bd); com.Parameters.AddWithValue("@bm",bm); com.Parameters.AddWithValue("@by",by); com.ExecuteNonQuery(); }}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)