Lecture de tables d'un DataSet impossible

cs_fmourmaux Messages postés 4 Date d'inscription samedi 12 juillet 2008 Statut Membre Dernière intervention 19 janvier 2009 - 17 sept. 2008 à 17:34
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 - 17 sept. 2008 à 19:36
Bonjour,

Je suis sous WebMatrix.(pour l'instant)

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="ProgId" content="Word.Document" /><meta name="Generator" content="Microsoft Word 10" /><meta name="Originator" content="Microsoft Word 10" /><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
--></style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->Voilà, j’ai réduit le problème à sa plus simple expression. J'ai une petite BD de gestion de mes élèves.

 

Au Page_Load, j’initialise une DDL, avec SUB
ChargerDDL_ListeClasses.

 

Ensuite, lors du choix dans la DDL, j’exécute

Sub DropDownListeClasses_SelectedIndexChanged

 

Qui simplement lance Sub AfficheEleves

 

Dans ce Sub, je remplis le oDataSet avec la table
« eleves », j'affiche dans un DataGrid.

 

Tout va bien.

 

Si j’essaye de lire la table, (pour faire des min, Max,
moyennes,…),j’ai toujours l’erreur

Object reference not set to an
instance of an object

 

Votre éclairage pourrait
m’aider.

Je pourrais fournir le petit bout de code à la personne qui accepterait de le regarder.

Merci à tous, et cordialement.

1 réponse

nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
17 sept. 2008 à 19:36
Salut,

Tu dois perdre les donnée lorsque la page est rechargée.
A chaque évenement les données de page sont mises à nulles et donc perdues.
0
Rejoignez-nous