We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ADO and PDF

I'm trying to learn syncfusion over the weekend, first time user.
Code behind attached. What I trying to do is use the Syncfusion tablesample and plug in my SQL statement (simple select) to get the asp.net page to work. I getting an error "Cannot find table 0." when I try to build the PDF file. It happens on this line of code:

'Create datatable
Dim dataTable As DataTable = dataSet.Tables(0)

But think the real problem start here:
Private Function GetNorthwindDataSet(ByVal selectCommand As String) As DataSet
Dim dataSet As DataSet = New DataSet()
Try
AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", True)
Dim connectionstring As String = ResolveApplicationDBPath("DSAMSConnectionString1") '("NorthwindIO.sdf")
Dim SqlMobileConnString1 As String = "Data Source = " + connectionstring
Dim conn As SqlConnection = New SqlConnection(SqlMobileConnString1)
conn.Open()
Dim Adapter As SqlDataAdapter = New SqlDataAdapter(DEF_DB_COMMAND2, conn)
Adapter.Fill(dataSet)

Catch
End Try

Return dataSet
I commented out "NorthwindIO.sdf I think that is the Northwind db file. I'm putting in my connection string from the webconfig.

Any help is appreciated I need to get this working and eventually call stored procedures to get results in the future.

Thanks,
Rob



vb-codebehind_332747b8.zip

1 Reply

GM Geetha M Syncfusion Team October 11, 2011 09:49 AM UTC

Hi Rob,

Thank you for your interest in Syncfusion products.

The samples shipped with install makes use of SQL Server Compact Edition to connect with database (Northwind.sdf). Could you please make sure if you would like to use the same for your application? Also, the connection string you get from webconfig is sent to ResolveApplicationDBPath("DSAMSConnectionString1"). Could you please check it?

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon