public DataTable getPermanentAddress(string strAssID) { //strCon.Open(); DataTable dtAddress = new DataTable(); strCon = new MySqlConnection(strConnection); strCon.Open(); MySqlCommand cmdPermanentAddress = strCon.CreateCommand();//new MySqlCommand("sp_getPermanentAddress", strCon); try { cmdPermanentAddress.CommandText = "sp_getPermanentAddress"; MySqlDataAdapter daPermanentAddress = new MySqlDataAdapter(cmdPermanentAddress); daPermanentAddress.SelectCommand.Parameters.Add("@AssociateId",MySqlDbType.Int32).Value = strAssID.ToString().Trim(); daPermanentAddress.SelectCommand.CommandType = CommandType.StoredProcedure; daPermanentAddress.Fill(dtAddress); return dtAddress; } catch (Exception ex) { throw (ex); } finally { if (strCon.State == ConnectionState.Open) { cmdPermanentAddress.Dispose(); strCon.Close(); strCon.Dispose(); } } }
-- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- -------------------------------------------------------------------------------- DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_getPermanentAddress`(In AssociateId integer) BEGIN select permanent_add from associate_details where associate_id = AssociateId; END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)