I have an eval version of the latest version of Aspose.Grid (version 2.0). When I perform a Databind to a SQL Query it appears to bind (has the correct number of rows in the grid) but no data is displayed.
ssql is a properly formated sql query statement...
1). Well, I am not sure about your data source table(s). Please make sure that your source table(s) has data in it. By the way, could you try to add the line to your code if it works:
e.g..,
sheet.EnableCreateBindColumnHeader = True
sheet.BindStartRow = 2
' Creates the data field column automatically.
sheet.CreateAutoGenratedColumns()
sheet.DataSource = ps
sheet.DataBind()
For reference, please check the source code of data binding demos in our feature demos:
2). I don't find the sizing problem with GridWeb, I tried your code (also tested other units e.g.., pixel, point etc.) and it works fine:
GridWeb1.Height = New Unit(60, UnitType.Percentage)
GridWeb1.Width = New Unit(75, UnitType.Percentage)
By the way where do you place this code? I mean which event / object / control you are using to write the code above. I places it in the Page_Load event for your info.
We appreciate if you could create a sample test web project with all the source files (for backend, you may also use some dummy table in MS Access Northwind database), zip it and post it here to reproduce both the issues you have mentioned. We will check it soon.
Also, kindly mention your env. OS, .NET framework version, IIS settings, Browser Type etc.
'Dim db As DemoDatabase = New DemoDatabase() Dim path As String = Page.MapPath(".") path = path.Substring(0, path.LastIndexOf("\")) path = path.Substring(0, path.LastIndexOf("\")) Dim oledbconnection1 As OleDb.OleDbConnection Dim oledbcommand1 As OleDb.OleDbCommand oledbconnection1 = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\gridtest\wms.mdb;User Id=admin;Password=;") oledbcommand1 = New OleDb.OleDbCommand oledbcommand1.Connection = oledbconnection1 oledbcommand1.CommandTimeout = 600
Dim ssql = "Select ItemNo,Description from tItemNo order by ItemNo " oledbcommand1.CommandText = ssql oledbcommand1.CommandType = System.Data.CommandType.Text oledbconnection1.Open() Dim ps = New DataSet Dim madaptor = New OleDb.OleDbDataAdapter(oledbcommand1) madaptor.Fill(ps) oledbconnection1.Close()
Dim sheet As WebWorksheet = GridWeb1.WebWorksheets(0)