public string getManagerDetails(string strAssId) { MySqlConnection strCon = new MySqlConnection(strConnection); strCon.Open(); MySqlCommand cmdMgrDetails = new MySqlCommand("sp_getManagerDetails", strCon); MySqlDataAdapter daMgrDetails = new MySqlDataAdapter(cmdMgrDetails); DataTable dtMgrDetails = new DataTable(); cmdMgrDetails.Parameters.Add("@assoId", MySqlDbType.Int32).Value = Convert.ToInt32(strAssId.Trim()); daMgrDetails.SelectCommand.CommandType = CommandType.StoredProcedure; daMgrDetails.Fill(dtMgrDetails); if (dtMgrDetails.Rows.Count != null || dtMgrDetails.Rows.Count.ToString() != "") { return dtMgrDetails.Rows[0]["associate_fname"].ToString(); } else { return ""; } strCon.Close(); }
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_getManagerDetails`(In assoId integer) BEGIN select associate_fname from associate_details where associate_id= (select manager_id from associate_details where associate_id=assoId); END
<add name="Constr" connectionString="dataSource=My_Server;Initial Catalog=MY_Database_Name;uid=My_User_Name;password=My_Password" providerName="MySql.Data.MySqlClient"/>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)