The following ASPX code works fine....
but if the code line in red color in the above code snippet is changed to
the following error gets generated:
'Add' is not a member of 'System.Data.DataTable'
Why so?
Thanks,
Regards,
Arpan
Code:
Sub Page_Load(obj As Object,ea As EventArgs)
Dim objDS As New DataSet
Dim objDT As New DataTable("Users")
objDT.Columns.Add("ID",Type.GetType("System.Int32"))
objDT.Columns.Add("FName",Type.GetType("System.String"))
objDT.Columns.Add("LName",Type.GetType("System.String"))
objDT.Columns("ID").AutoIncrement=True[red]
objDS.Tables.Add(objDT)
[/red]
Dim objDR As DataRow=objDT.NewRow()
Code:
[red] objDS.Tables("Users").Add(objDT)
[/red]
'Add' is not a member of 'System.Data.DataTable'
Why so?
Thanks,
Regards,
Arpan