syntax
-
hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data
While reader.Read() 'do stuff here... End While
can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18 -
hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data
While reader.Read() 'do stuff here... End While
can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18Adapter ad = new Adapter(); DataSet ds = new DataSet(); ad.Fill(ds); int count = ds.Tables[0].Rows.Count; for(int iLoop = 0; i < count; ++i) { Response.Write(ds.Tabls[0].Rows[i]["ColumnName"].ToString()); } Here, instead of ColumnName you can give the ColumnIndex also.
-
hi... when using reader in ASP.NET using VB.NET..this is how i get ALL the data
While reader.Read() 'do stuff here... End While
can u pls tell me the SYNTAX of how to do the above same thing if i am using dataset??? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18foreach( DataRow row in ds.Table[0].Rows )
-
foreach( DataRow row in ds.Table[0].Rows )
I AM USING VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
foreach( DataRow row in ds.Table[0].Rows )
datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
DataRow is a class name, not a keyword. You probably should try this: For Each row As DataRow In dataSet.dataTable.Rows Insert code here Next Edbert P. Sydney, Australia.
actually i am more concerned about using cols...
For Each dr In ds.Tables("default").Rows i = -1 For colCounter = 1 To ds.Tables("default").Columns.Count i = i + 1 If IsDBNull(ds.Tables("default").Rows(rowCounter)(ds.Tables("default").Columns(i))) Then columnData = " - " Else columnData = dr.Item(i) End If Next
is ter eany way i can stop using (i) in the above code??? tks a lot.... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18 -
datarow IS NOTA KEYWORD IN VB.NET "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
No need to shout, just read the docs. But then if you wanted to read you'd be learning C# :):laugh:
-
No need to shout, just read the docs. But then if you wanted to read you'd be learning C# :):laugh:
:wtf: "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
actually i am more concerned about using cols...
For Each dr In ds.Tables("default").Rows i = -1 For colCounter = 1 To ds.Tables("default").Columns.Count i = i + 1 If IsDBNull(ds.Tables("default").Rows(rowCounter)(ds.Tables("default").Columns(i))) Then columnData = " - " Else columnData = dr.Item(i) End If Next
is ter eany way i can stop using (i) in the above code??? tks a lot.... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18You can do it in at least two different ways: 1. Iterate through rows and then columns For Each dr As DataRow In ds.Tables("default").Rows For Each dc As DataColumn In ds.Tables("default").Columns If IsDBNull(dr(dc)) Then columnData = " - " Else columnData = dr(dc) End If Next dc Next dr 2. Iterate through rows and the items For Each dr As DataRow In ds.Tables("default").Rows For Each obj As Object In dr.ItemArray If IsDBNull(obj) Then columnData = " - " Else columnData = obj End If Next dc Next dr Read the documentation on MSDN for more examples and explanation about this. I hope it helps :) Edbert P. Sydney, Australia.
-
You can do it in at least two different ways: 1. Iterate through rows and then columns For Each dr As DataRow In ds.Tables("default").Rows For Each dc As DataColumn In ds.Tables("default").Columns If IsDBNull(dr(dc)) Then columnData = " - " Else columnData = dr(dc) End If Next dc Next dr 2. Iterate through rows and the items For Each dr As DataRow In ds.Tables("default").Rows For Each obj As Object In dr.ItemArray If IsDBNull(obj) Then columnData = " - " Else columnData = obj End If Next dc Next dr Read the documentation on MSDN for more examples and explanation about this. I hope it helps :) Edbert P. Sydney, Australia.
tks buddy.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18