How to fetch dataset value and assing to another interger variable. [Resolved]

Posted by Karthik2010_Mca under C# on 10/7/2013 | Points: 10 | Views : 989 | Status : [Member] | Replies : 1
Hi,

The dataset variable return one integer value (Ex:1034).
I wanted to store from dataset value to another int variable.

DataSet dssession;
SqlParameter[] arParameters = new SqlParameter[2];
arParameters[0] = new SqlParameter("@SessionName", txtbxSessionName.Text);
arParameters[1] = new SqlParameter("@Brand", brandId);
dssession = dh.ExecuteDataSet("uspGetSessionId", CommandType.StoredProcedure, arParameters);

Thanks

Karthik


Responses

Posted by: Bandi on: 10/7/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
int intValue = 0;
if(dssession .Tables[0].Rows.Count!=0)
{
intValue = (int) dssession.Tables[0].Rows[0][0]; //1st row and 1st column
}

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response