SqlDataSource sbagliato (forse)

giovedì 19 ottobre 2006 - 15.55

satoshy Profilo | Newbie

Ciao a tutti,
stò facendo le mie prime prove con gridView e DataSource ma mi ritorna sempre un errore

A field or property with the name 'titolo' was not found on the selected data source.

Stò usando un DB mysql5 installato in locale con questo schema

CREATE TABLE `news` ( `id_news` int(11) NOT NULL auto_increment, ` titolo` varchar(255) NOT NULL default '', `abstract` text, `testo` text NOT NULL, `data_inserimento` datetime NOT NULL, PRIMARY KEY (`id_news`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

mentre nella pagina asp.net ho messo un semplice dataSource e un gridView

<asp:Gridview runat="server" ID="dgNews" DataSourceID="MySqlSource">
<Columns>
<asp:BoundField DataField="titolo" HeaderText="Titolos" />
<asp:BoundField DataField="data_inserimento" HeaderText="Data Inserimento" />
</Columns>
</asp:GridView>

<asp:SqlDataSource ID="MySqlSource" runat="server" ConnectionString="<%$ ConnectionStrings:LocalMySql %>" ProviderName="<%$ ConnectionStrings:LocalMySql.ProviderName %>" SelectCommand="SELECT * FROM news"></asp:SqlDataSource>


Perchè mi dice che non trova il campo titolo?

thx!
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5