我倒,DataRow dr不能独立定义吧 要不你先定义一个DataTable DataTable dt = new DataTable; DataRow dr = dt.NewRow();dr = ds.Tables["userInfo"].Rows[1]
DataRow dr = ds.Tables["userInfo"].Rows[1] -->>> Dim dr as DataRow = ....看了半天才看出来,混血儿
Console.WriteLine(dr["name"].ToString())
原来是c#和vb.net的语法搞混了,还是 acewang(大灰很)厉害
还有,引用属性的时候C#是[] 而vb.net应该是()
原来是c#和vb.net的语法搞混了!
刚才用了lanku(路边端碗的)和brightheroes(闭关(正在修练基本功)) 的方法试了一下 还是报同样的错误: 'DataRow' is a type and cannot be used as an expression 或者'DataTable' is a type and cannot be used as an expression
要不你先定义一个DataTable
DataTable dt = new DataTable;
DataRow dr = dt.NewRow();dr = ds.Tables["userInfo"].Rows[1]
-->>>
Dim dr as DataRow = ....看了半天才看出来,混血儿
还是报同样的错误:
'DataRow' is a type and cannot be used as an expression
或者'DataTable' is a type and cannot be used as an expression
回复人: acewang(大灰很) ( ) 信誉:100 2003-12-19 16:24:00 得分:0
还有,引用属性的时候C#是[] 而vb.net应该是()
dr = ds.Tables["userInfo"].Rows[1];