473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

parentrow

Dear all

My question is mixed between c# and sql so I would perfere to ask here

I want to insert data in sql database but by using C# language...and I two table with relationship between them...the first one has a parent row of the sec. one and the vice versa..the sec. one has childrow of the first one

to insert the data by these philosopy I used dataset..then I update the data in the sql server....

like


DataRow floorsrow = floors.NewRow();
for (int i = 0; i < Buliding.Rows.Count; i++)
{

if (thedata.Tables["Buliding"].Rows[i]["Buliding"].ToString() == comboBox1.SelectedItem.ToString())
{
string x = string.Format("{0}-{1}", comboBox1.SelectedItem.ToString(), fl.ToString());
x = x.Replace(" ", "");
floorsrow["Floor"] = x.ToString();
floorsrow.SetParentRow(thedata.Tables["Buliding"].Rows[i]);
floors.Rows.Add(floorsrow);

}

}

bulidingadapter.Update(thedata, "Buliding");

so the question how could l inset this data with this relation directly to the database without using dataset

thanks
Feb 12 '09 #1
0 899

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bhavna | last post by:
Hi, i wanted to ask if it is possible for a datagrid to display a parent-child realtionship like this: ParentRow ChildRow ChildRow ParentRow ChildRow
0
by: Bob Rundle | last post by:
I'm using the XML Schema Designer to create a dataset. I can't get the relationships to work from the XML. To get them to work, I have to explicitly code them in. What's wrong here? Here is...
3
by: Maarten | last post by:
hi all, i'm just trying to get a datagrid like this and can't find it anywhere +-parentrow(Analog Inputs) childrow (DA1) childrow (DA2) childrow (DA3) childrow (DA4) +-parentrow(Analog...
7
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
1
by: KenRoy | last post by:
I have a datagrid with a child relationship. If I use the default TableStyle everything works fine and when I drill down into a child, the ParentRow shows in the header with the column names and...
0
by: Digimode | last post by:
When using a non CaseSensitive DataSet which has 2 tables, a parent and a child with a one to one relationship (using col1 from both tables), as a datasource for an DataGrid, the grid does not show...
4
by: SteveT | last post by:
I am wanting to populate several treeviews, one for the <TRs> group and one for the <TGsgroup. Is there a simplier way to populate the Treeview than the one I did below? It seems difficult to...
4
by: Daniel | last post by:
What's wrong with this code? 1 Dim parentRow, childRow as DataRow 2 3 For i = 0 To mainDataTable.Rows.Count - 1 4 parentRow = mainDataTable.Rows(i) 5 childRow =...
5
KodeKrazy
by: KodeKrazy | last post by:
I have a table with the following columns, ID (A unique value) Style#, Color, Size (There a more columns than that, but those are the ones I will need for this exercise.) There is a row for each...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.