Click here to Skip to main content
16,009,407 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: binding data to datagrid Pin
Tirthadip9-Jul-07 0:00
Tirthadip9-Jul-07 0:00 
why are u using datareader and dataset simultaneously???
follow this...

'1. Create a connection<br />
    Dim myConnection as New SqlConnection(<br />
          ConfigurationSettings.AppSettings("connectionString"))<br />
<br />
    '2. Create the command object, passing in the SQL string<br />
    Const strSQL as String = "SELECT * FROM myTable"<br />
    Dim myCommand as New SqlCommand(strSQL, myConnection)<br />
<br />
    'Set the datagrid's datasource to the datareader and databind<br />
    myConnection.Open()<br />
    DataGrid1.DataSource = myCommand.ExecuteReader(<br />
                              CommandBehavior.CloseConnection)<br />
    DataGrid1.DataBind()


but keep in mind

A datareader is a read-only object. If you need to edit and update changes you need to use a dataset.

Tirtha

Do not go where the path may lead, go instead where there is no path and leave a trail.

Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist

GeneralRe: binding data to datagrid Pin
$h@ma!|@9-Jul-07 0:15
$h@ma!|@9-Jul-07 0:15 
GeneralRe: binding data to datagrid Pin
$h@ma!|@9-Jul-07 0:54
$h@ma!|@9-Jul-07 0:54 
GeneralRe: binding data to datagrid Pin
Tirthadip9-Jul-07 1:05
Tirthadip9-Jul-07 1:05 
GeneralRe: binding data to datagrid Pin
valerian.precop9-Jul-07 1:35
valerian.precop9-Jul-07 1:35 
GeneralRe: binding data to datagrid Pin
$h@ma!|@9-Jul-07 22:54
$h@ma!|@9-Jul-07 22:54 
QuestionInclude tag Pin
Vineed8-Jul-07 22:59
Vineed8-Jul-07 22:59 
AnswerRe: Include tag Pin
N a v a n e e t h8-Jul-07 23:26
N a v a n e e t h8-Jul-07 23:26 
GeneralRe: Include tag Pin
Vineed9-Jul-07 1:14
Vineed9-Jul-07 1:14 
GeneralRe: Include tag Pin
N a v a n e e t h9-Jul-07 19:02
N a v a n e e t h9-Jul-07 19:02 
GeneralRe: Include tag Pin
Vineed9-Jul-07 20:04
Vineed9-Jul-07 20:04 
AnswerRe: Include tag Pin
Paddy Boyd8-Jul-07 23:28
Paddy Boyd8-Jul-07 23:28 
GeneralRe: Include tag Pin
Vineed9-Jul-07 1:16
Vineed9-Jul-07 1:16 
QuestionHow to finde scroll bar position in javascript Pin
Piyush Vardhan Singh8-Jul-07 22:57
Piyush Vardhan Singh8-Jul-07 22:57 
AnswerRe: How to finde scroll bar position in javascript Pin
Michael Sync8-Jul-07 23:55
Michael Sync8-Jul-07 23:55 
AnswerRe: How to finde scroll bar position in javascript Pin
Michael Sync8-Jul-07 23:56
Michael Sync8-Jul-07 23:56 
AnswerRe: How to finde scroll bar position in javascript Pin
Parwej Ahamad9-Jul-07 1:01
professionalParwej Ahamad9-Jul-07 1:01 
QuestionGroupBy in datatable?? Pin
playout8-Jul-07 22:52
playout8-Jul-07 22:52 
AnswerRe: GroupBy in datatable?? Pin
VenkataRamana.Gali8-Jul-07 23:11
VenkataRamana.Gali8-Jul-07 23:11 
GeneralRe: GroupBy in datatable?? Pin
playout8-Jul-07 23:19
playout8-Jul-07 23:19 
AnswerRe: GroupBy in datatable?? Pin
Imran Khan Pathan8-Jul-07 23:19
Imran Khan Pathan8-Jul-07 23:19 
GeneralRe: GroupBy in datatable?? Pin
playout8-Jul-07 23:29
playout8-Jul-07 23:29 
GeneralRe: GroupBy in datatable?? Pin
Imran Khan Pathan8-Jul-07 23:49
Imran Khan Pathan8-Jul-07 23:49 
QuestionApplication counter Pin
saravanan058-Jul-07 22:42
saravanan058-Jul-07 22:42 
AnswerRe: Application counter Pin
sidbaruah8-Jul-07 22:44
sidbaruah8-Jul-07 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.