| Author: Balamurali Balaji 08 May 2008 | Member Level: Diamond Points : 2 |
Hi,
You've built a dataset from a xml file. There is no proper explanation for this, instead you write more code to get the xml back from the dataset and read the dataset row by row to display data on the console, which is not required.
Please add few lines of explanation and correct the code accordingly.
Goodluck
|
| Author: komaladevi 08 May 2008 | Member Level: Gold Points : 2 |
Thank you for your feed back
|
| Author: komaladevi 08 May 2008 | Member Level: Gold Points : 2 |
as this is the code snippet i gave the simple code if u want me to explain then its okay i will
|
| Author: vivek kushwaha 08 May 2008 | Member Level: Silver Points : 2 |
'' Alternative of XML. this is a master class function which returns dataset according to parameters.
Public strconnect As String = (ConfigurationSettings.AppSettings("dsn_SQL"))
Public Function sendDataset(ByVal strsql As String, Optional ByVal Addnewrecord As Boolean = False) As DataSet Try Dim connection As New SqlClient.SqlConnection(strconnect) connection.Open() Dim adapter As New SqlClient.SqlDataAdapter(strsql, connection) Dim dataset As New DataSet Dim Dtype As String adapter.Fill(dataset) If Addnewrecord = True Then Dim myNewRow As DataRow Dim rowVals(dataset.Tables(0).Columns.Count - 1) As Object rowVals(0) = 1 myNewRow = dataset.Tables(0).Rows.Add(rowVals) End If sendDataset = dataset adapter.Dispose() connection.Close()
Catch err As Exception Throw (err) End Try End Function
|
| Author: Balamurali Balaji 08 May 2008 | Member Level: Diamond Points : 2 |
Hi,
You haven't stated the purpose of the code snippet clearly and explained the same.
Please add few explanations and remove the un-wanted code.
Good luck
|
| Author: vivek kushwaha 08 May 2008 | Member Level: Silver Points : 2 |
post this fuction in the main class file. use the function on which form you want to fill dataset using your query.
|
| Author: vivek kushwaha 08 May 2008 | Member Level: Silver Points : 2 |
'like create a form form1.aspx 'create an object of class class1.vb in which above function exist. dim clsm as new class1 'on page load event clsm.senddataset("select * from table1")
''all you got.
|