sb.Append("SELECT id,username,name,surname,email,status,is_active FROM users")
sb.Append(" ORDER BY id ASC")
sqlUser = sb.ToString
cmd = New SqlCommand
With cmd
.CommandText = sqlUser
.Connection = conn
dr = .ExecuteReader
If dr.HasRows Then
dt = New DataTable
dt.Load(dr)
dgUser.DataSource = dt
Else
dgUser.DataSource = Nothing
End If
End With
dr.Close()
Tag : .NET, VS 2010 (.NET 4.x), VS 2012 (.NET 4.x), Windows