query
-
str = dss.Tables[0].Rows[0].Item[1].ToString(); It is giving error at all ".Item[1]" s of the block : 'System.Data.DataRow' does not contain a definition for 'Item'
here items(1) its working in vb u try by putting dot(.)after rows(0). i think columns(1) is there. try in debug mode so u know exactly.
-
str = dss.Tables[0].Rows[0].Item[1].ToString(); It is giving error at all ".Item[1]" s of the block : 'System.Data.DataRow' does not contain a definition for 'Item'
Nekshan wrote:
'System.Data.DataRow' does not contain a definition for 'Item'
You get this error because 'Item' doesn't exist. Use this instead:
str = dss.Tables[0].Rows[0][1].ToString();
or
str = dss.Tables[0].Rows[0].ItemArray[1].ToString();
Visual Studio can't evaluate this, can you?
public object moo { __get { return moo; } __set { moo = value; } }
-
here items(1) its working in vb u try by putting dot(.)after rows(0). i think columns(1) is there. try in debug mode so u know exactly.
No, '.columns[1]' is also not there after .rows[0] After tables[0].rows[0] is there and ------tables[0].columns[0] is there. how to use? if possible chk it wen u have time, i m leaving office now. Going home, if net is working send u the copy of documentatn. ok. cu soon. tc. thanx. regards nekshan.
-
str = dss.Tables[0].Rows[0].Item[1].ToString(); It is giving error at all ".Item[1]" s of the block : 'System.Data.DataRow' does not contain a definition for 'Item'
Don't use .Item[1]. Instead, you would write this as dss.Tables[0].Rows[0][1].ToString();. Note that it is a bad idea to rely on the ordinal position though - try using the column name instead. That way, if you reorder the columns in your query you aren't going to get unexpected results.
Deja View - the feeling that you've seen this post before.
-
Nekshan wrote:
'System.Data.DataRow' does not contain a definition for 'Item'
You get this error because 'Item' doesn't exist. Use this instead:
str = dss.Tables[0].Rows[0][1].ToString();
or
str = dss.Tables[0].Rows[0].ItemArray[1].ToString();
Visual Studio can't evaluate this, can you?
public object moo { __get { return moo; } __set { moo = value; } }
-
No, '.columns[1]' is also not there after .rows[0] After tables[0].rows[0] is there and ------tables[0].columns[0] is there. how to use? if possible chk it wen u have time, i m leaving office now. Going home, if net is working send u the copy of documentatn. ok. cu soon. tc. thanx. regards nekshan.
ok. columns(0).item(0).tostring() or columns(0).rows(0).tostring() try this.
-
str = dss.Tables[0].Rows[0].Item[1].ToString(); It is giving error at all ".Item[1]" s of the block : 'System.Data.DataRow' does not contain a definition for 'Item'
i will call u in night ok.bye..
-
str = dss.Tables[0].Rows[0].Item[1].ToString(); It is giving error at all ".Item[1]" s of the block : 'System.Data.DataRow' does not contain a definition for 'Item'
conn.Open(); SqlCommand cmm = new SqlCommand("select url, sitehit, survey, tellafriend, addtooutlook from tblsummary", conn); SqlDataAdapter ad = new SqlDataAdapter(cmm); DataSet ds = new DataSet(); ad.Fill(ds, "tblsummary"); string str Dim ds As DataSet1 if (ds.Tables(0).Rows.Count != 0) { string str =""; Str = ds.Tables(0).Rows(0)(0).tostring() str += ds.Tables(0).Rows(0)(1).ToString(); str += ds.Tables(0).Rows(0)(2).ToString(); str += ds.Tables(0).Rows(0)(3).ToString(); str += ds.Tables(0).Rows(0)(4).ToString(); } MessageBox.Show(str);