at this time I try to connect to a SQL-Database with ASP.net.
That works very well with DataGrid, but I want to add a new Column to the DataGrid with the number of the database rows.
The column have to be the first Column of DataGrid.
I want to create a function (with for-loop) to count the number of the row of a DataGrid and write it into DataGrid's first Column.
The number of Rows gets the DataGrid by the SQL-Database.
The SQL Database shouldn't get a new Column. I just want to create the column dynamically.
How could I realize this ?
Here you can see my SourceCode:
Dim connStr As String = "server=WU900136\SQLEXPRESS; database=GT; Trusted_Connection=yes"
Dim conn As New SqlConnection(connStr)
Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
Private Dataset As DataSet
Dim sql As String = "SELECT Bezeichnung Thema, starttermin Beginn, endtermin Ende From GR_Seminare, Gr_Termine WHERE Gr_Seminare.SemId=Gr_Termine.SemId"
Dim cmd As New SqlCommand(sql, conn)
Dim DataReader As SqlDataReader
DataReader = cmd.E
View Complete Post