asp.net datagrid only shows 6 columns
Posted by: Mark Kiel
Date: February 08, 2005 10:56AM

Hello all!

I've successfully connected to a mysql database from asp.net. My problem is that when I fill datagrid object with more than 6 columns, the first six columns display accurately, but columns 7 and greater display null cells!! Has anyone else experienced this problem?

No matter which tables I query or columns I choose, the same error occurs.

vb.net code for mysql command:

***************************************************************
Dim selectCMD As MySqlCommand = New MySqlCommand("SELECT a.may as May, a.june as Jun,a.july as Jul, a.august as Aug, a.september as Sep, a.october as Oct, a.november as Nov, a.december as Dece FROM saves a, measure b, scenario c where a.measure_id = b.measure_id and a.scenario_id = c.scenario_id;")
selectCMD.Connection = csconn

'load data into datagrid1
datagrid1.DataSource = selectCMD.ExecuteReader(CommandBehavior.CloseConnection)
datagrid1.DataBind()
csconn.Close()

****************************************************************


asp.net datagrid:

**************************************************************
<asp:datagrid id="datagrid1" style="POSITION: absolute; TOP: 295px" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="May" HeaderText="May" />
<asp:BoundColumn DataField="Jun" HeaderText="Jun" />
<asp:BoundColumn DataField="Jul" HeaderText="Jul" />
<asp:BoundColumn DataField="Aug" HeaderText="Aug" />
<asp:BoundColumn DataField="Sep" HeaderText="Sep" />
<asp:BoundColumn DataField="Oct" HeaderText="Oct" />
<asp:BoundColumn DataField="Nov" HeaderText="Nov" />
<asp:BoundColumn DataField="Dece" HeaderText="Dec" />
</Columns>
***************************************************************

Please help!!!

Options: ReplyQuote


Subject
Written By
Posted
asp.net datagrid only shows 6 columns
February 08, 2005 10:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.