Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataView.Sort not working Pin
Alomgir Miah4-Aug-05 4:45
Alomgir Miah4-Aug-05 4:45 
GeneralRe: DataView.Sort not working Pin
livez4-Aug-05 4:59
livez4-Aug-05 4:59 
GeneralClass Constructor not getting called when creating array of class object Pin
Mutty4-Aug-05 3:15
Mutty4-Aug-05 3:15 
GeneralRe: Class Constructor not getting called when creating array of class object Pin
Sean Michael Murphy4-Aug-05 3:32
Sean Michael Murphy4-Aug-05 3:32 
GeneralRe: Class Constructor not getting called when creating array of class object Pin
Mutty4-Aug-05 4:45
Mutty4-Aug-05 4:45 
Generalcreate a relation betwn 2 tables in a dataset Pin
dhol4-Aug-05 3:12
dhol4-Aug-05 3:12 
GeneralRe: create a relation betwn 2 tables in a dataset Pin
Alomgir Miah4-Aug-05 3:55
Alomgir Miah4-Aug-05 3:55 
GeneralRe: create a relation betwn 2 tables in a dataset Pin
dhol5-Aug-05 2:44
dhol5-Aug-05 2:44 
I am new to c#, so i am learning right now.

In a form , i had designed with a datagrid and a button.
now i have added a datset
and
coded as fllows


private void button1_Click(object sender, System.EventArgs e)
{
DataSet ds = new DataSet();
DataSet xml1 = new DataSet();
xml1.ReadXml("C:\\CDEV\\relationcosttypeandcode\\cost_code.xml");
DataTable dt1 = xml1.Tables["cost_code"].Copy();

DataSet xml2 = new DataSet();
xml2.ReadXml("C:\\CDEV\\relationcosttypeandcode\\cost_type.xml");
DataTable dt2 = xml2.Tables["cost_type"].Copy();
ds.Tables.Add(dt1);
ds.Tables.Add(dt2);


DataColumn parentCol = ds.Tables["cost_code"].Columns["cost_type"];
DataColumn childCol = ds.Tables["cost_type"].Columns["cost_type"];

DataRelation relTable1Table2;
relTable1Table2 = new DataRelation("cost_typecost_code", parentCol, childCol);
ds.Relations.Add(relTable1Table2);

dataGrid1.DataSource = ds;

}


after running this i get a error when clicking the button

"Column argument cannot be Null".



Pls any one help me to do this

santhosh


Nation of complete domination
GeneralSQL server 2k Database connection from ASP.NET Pin
Neel074-Aug-05 2:57
Neel074-Aug-05 2:57 
AnswerRe: SQL server 2k Database connection from ASP.NET Pin
Michael P Butler4-Aug-05 3:43
Michael P Butler4-Aug-05 3:43 
GeneralControl collection Pin
magnifique4-Aug-05 1:44
magnifique4-Aug-05 1:44 
GeneralRe: Control collection Pin
Roger Stewart4-Aug-05 3:45
professionalRoger Stewart4-Aug-05 3:45 
GeneralRe: Control collection Pin
magnifique5-Aug-05 0:16
magnifique5-Aug-05 0:16 
Generali need to ask u some questions to get started in doing a database Pin
nidhelp4-Aug-05 0:52
nidhelp4-Aug-05 0:52 
GeneralRe: i need to ask u some questions to get started in doing a database Pin
magnifique4-Aug-05 1:42
magnifique4-Aug-05 1:42 
GeneralRe: i need to ask u some questions to get started in doing a database Pin
nidhelp4-Aug-05 14:52
nidhelp4-Aug-05 14:52 
GeneralLogging Window Pin
Verio6664-Aug-05 0:33
sussVerio6664-Aug-05 0:33 
QuestionHow to delete row in datagrid/datatable with a delete button Pin
Atlemann4-Aug-05 0:30
Atlemann4-Aug-05 0:30 
AnswerRe: How to delete row in datagrid/datatable with a delete button Pin
deep74-Aug-05 0:48
deep74-Aug-05 0:48 
GeneralRe: How to delete row in datagrid/datatable with a delete button Pin
Atlemann4-Aug-05 3:06
Atlemann4-Aug-05 3:06 
GeneralRe: How to delete row in datagrid/datatable with a delete button Pin
Alomgir Miah4-Aug-05 4:26
Alomgir Miah4-Aug-05 4:26 
GeneralRe: How to delete row in datagrid/datatable with a delete button Pin
Atlemann4-Aug-05 20:33
Atlemann4-Aug-05 20:33 
GeneralRe: How to delete row in datagrid/datatable with a delete button Pin
Atlemann4-Aug-05 20:50
Atlemann4-Aug-05 20:50 
QuestionHow to shedule Tasks using C# ? Pin
pubududilena4-Aug-05 0:26
pubududilena4-Aug-05 0:26 
AnswerRe: How to shedule Tasks using C# ? Pin
Sean Michael Murphy4-Aug-05 3:38
Sean Michael Murphy4-Aug-05 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.