VBNet2008 Transfer DATAREADER rows to CrystalReport DataSet1.xsd
- by lennie
Hi Good Guys,
I need your help. Please help me as I am a newbie using VB.NET.
I have been asked to transfer DATAREADER rows into Crystal Report DATASET1.XSD
Here are the coding
Private Sub BtnTransfer()
dim strsql as string = "Select OrderID, OrderDate from ORDERS"
dim DS as new dataset1 '<---crysal report dataset1.xsd
dim DR as SqlDataReader
dim RW as DataRow = DS.Tables(0).NewRow
sqlconn = new sqlconnection(ConnString)
sqlcmd = new sqlCommand(strSql, sqlconn)
sqlcmd.Connection.open()
DR = sqlcmd.ExecuteReader(CommandBehaviour.CloseConnection)
Do while DR.READ
RW("OrderID") = DR("OrderID")
RW("OrderDate") = DR(OrderDate")
DS.Tables(0).Rows.ADD(RW)
Loop
End sub