Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i'm trying to get a "typisierte" DataSet like this: (from MSDN)

// This accesses the CustomerID column in the first row of 
// the Customers table.
string s;
s = dsCustomersOrders1.Customers[0].CustomerID;

 

what do you call for "typisiert"? (My MSDN is in german, so i don't know the english word)

 

i tried to look in MSDN but didn't find an example code for making "typisierte" DataSet. Should i extend the DataSet like this?

public class DataSetExt : DataSet 
{
	//... with all set and get for each specific tables and column names 
	}

 

or how should i do it?

 

thx in advance. :)

Posted

and how can i do that?

 

i tried to write like this:

public class DataSetExt : DataSet 
{
	private int pos_objadr1;

	public DataTable OL 
	{
		get 
		{
			return this.Tables["OL"];
		}

		public objadr1 
		{
			return this.Tables["OL"].Columns[pos_objadr1];
		}
	}
}

 

with this i can write "myDataSetExt.OL" to get the table "OL", right?

 

but what should i do so i can write "myDataSetExt.OL(1).objadr1" to get line 1 column pos_objadr1 from table OL?

i tried to make objadr1 inside OL like up there, but it doesn't work....

 

 

Thx.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...