Moiz Saifuddin
asked on
DataColumn Add
I have this statement where custDs is the dataset I populate and then am trying to add a column of string type to the
custds.tables(0).Columns.A dd("Total" ,system.ty pe.gettype ("system.s tring"))
but im getting this error on runtime,any ideas since my syntax or order is
System.ArgumentNullExcepti on: 'dataType' argument cannot be null. Parameter name: dataType at System.Data.DataColumn..ct or(String columnName, Type dataType, String expr, MappingType type) at System.Data.DataColumnColl ection.Add (String columnName, Type type) at ASP.moiz_aspx.Button1_Clic k(Object sender, EventArgs e)
custds.tables(0).Columns.A
but im getting this error on runtime,any ideas since my syntax or order is
System.ArgumentNullExcepti
cn.Open()
Dim sqlstring as String ="select * from persons"
Dim sql1command as sqlcommand
sql1command = new sqlcommand(sqlstring,cn)
Dim custDA As SqlDataAdapter = New SqlDataAdapter("select * from persons", cn)
Dim custDS As DataSet = New DataSet()
custDA.Fill(custDS, "persons")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the explicit declaration of the column was key
custds.tables(0).Columns.A