Hi,
I need to take the connection string according to the userId from the session variable.
According to the user the connection string will differ.So please help me
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public string GetData()
{
string constr = @"";
DataTable dt = new DataTable();
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("select Month,Predicted,Actual from _Data where uId= ", con))
{
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
return GetJson(dt);
//return ConvertTableToJSON(dt);
}
}
}