Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dataset could not be found
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00692085
Message ID:
00692092
Vues:
14
All variables created in methods are considered "Local" to their own method. You need to create a field for dsStaff to reference it from other methods besides Page_Load. Right after the Class declaration, enter a line like the following:
protected DataSet dsStaff;
>I am getting the error "The type or namespace name 'dsStaff' could not be found (are you missing a using directive or an assembly reference?)" The error is from the following reference to dsStaff (which is underlined in blue). Any idea what is causing this or how to fix it?
>
>
>private void txtName_DataBinding(object sender, System.EventArgs e)
>{
>	txtName.Text = dsStaff.staff[0].name;
>}
>
>
>The code in the page load that creates the dataset is as follows.
>
>
>		private void Page_Load(object sender, System.EventArgs e)
>		{
>			// Put user code to initialize the page here
>			// create staff object
>			int lnStaffID;
>			Staff oStaff = new Staff();
>			String lcStaffXML;
>			DataSet dsStaff = new DataSet();
>
>			lnStaffID = Convert.ToInt32(Request.QueryString.Get("id"));
>			lcStaffXML = oStaff.GetRecord(lnStaffID);
>			dsStaff.ReadXml(lcStaffXML);
>			this.DataBind();
>			}
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform