Hi guys,
I have asp.net website in c#.
i have Dropdownlist SelectedIndexChanged event, to get values.
Code
DataTable dt = new DataTable();
SqlParameter[] p = new SqlParameter[1];
p[0] = new SqlParameter("@RefID", Convert.ToInt32(i));
dt = dl.GetDataWithParameters("Sp_WT_GetRef", p);
b.Text = dt.Rows[0]["unit"].ToString();
c.Text = dt.Rows[0]["PriceInUSD"].ToString();
a.Text = dt.Rows[0]["description"].ToString();
GetDataWithParameters Method
public DataTable GetDataWithParameters(string StoredProcedureName, SqlParameter[] param)
{
SqlConnection conn = null;
try
{
DataTable tb = null;
conn = conn = GetConnectionString();
DataSet ds = SqlHelper.ExecuteDataset(conn, CommandType.StoredProcedure, StoredProcedureName, param);
tb = ds.Tables[0];
return tb;
}
catch (Exception ee)
{
return null;
}
finally
{
conn.Close();
}
}
Stored Procedure
alter Proc Sp_WT_GetRef
(@RefID int)
as
SELECT [RecID]
,[RefCode]
,[Description]
,[Unit]
,[PriceInUSD]
FROM [tbl_WT_References]
Where RecID = @RefID
n i have published on client server(ftp).
its taking minimum 6 seconds to gets the values...
can any one plz help me, how can i get these values fast....
Thanks