Data sets and relations between one table

P

Piotr Karwatka

Hi!


I need to do relation beetwen one table (task 2 task) and i do something
like that"


DataSet data = new DataSet();
myCommand.Fill(data);

// i fill my data adapter with one query like: SELECT * FROM Zadanie....
data.Tables[0].TableName = "Zadanie";
//data.Tables[1].TableName = "Zadanie";


string relName = "Taks2Tasks";
DataRelation rel = new DataRelation(relName,
data.Tables["Zadanie"].Columns["IdZadania"],
data.Tables["Zadanie"].Columns["Zadanie_IdZadania"]);
data.Relations.Add(rel);

DataGrid1.DataSource=data;
DataGrid1.DataBind();

And that makes an error: System.ArgumentException: This limit cannot be
switched on because not all values have parent values - and thats right not
all tasks have parent tasks but that the specific of problem is. So What I
should to do?

Thanks for excpetion!
 
P

Piotr Karwatka

Hi

I do this relation because I want to use Microsoft Nesteed Data grid - i
want to make nesteed data grids (i'm making a project management software
and i want to make a tasks treeview - one tasks depends on the other ..)
Could you help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top