VBNet2008 Transfer DATAREADER rows to CrystalReport DataSet1.xsd
Posted
by lennie
on Stack Overflow
See other posts from Stack Overflow
or by lennie
Published on 2010-03-15T04:48:36Z
Indexed on
2010/03/15
4:49 UTC
Read the original article
Hit count: 503
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
© Stack Overflow or respective owner