Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27046

[RESOLVED] To give SerialNo of the Record in DatagridView

$
0
0
I'm Retrieving datas into a DGView with a datareader object. In the process is it possible to automatically give Serial numbers for the records (starting from 1) to the first column of the DGV... ??
This is how I retrieve.


Code:

        Dim vRs As SqlClient.SqlDataReader
        Dim vSqlText As String
        Dim Table As New DataTable
       
        vSqlText = "Select DevoteeID, DevoteeName from B_Devotee order by DevoteeName"
        vRs = CreateReader(vSqlText) '..... a public function
        Table.Load(vRs)
        Grid1.DataSource = Table

As per this Sql Statement the I column is DevoteeId and II column is DevoteeName. I want some kind of a alteration to this Sql statement by which i want to see "SlNo" as Col I, DevoteeID as col II and DevoteeName as Col III.

Viewing all articles
Browse latest Browse all 27046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>