Click here to Skip to main content
15,919,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi friends please help me.

in my project i created one webpage territory details, i use one data grid and multiple of countries names and codes added to the grid. i have to send total grid values(like a table)to database after that i insert the data in a table,so i don't have any idea please give your valuable suggestions
thanks in advance
Posted

if you have done the grid using the DataSet it's an easy task..

Create a typed dataset (you can have all the db interaction using the autogenerated code, or else you have to write your own dynamic sql/stored procedure and attach it.

if suppose you have a Save button in the page in the click event you can iterate through the grid and fill it in the dataset and then update in the db.

//typed dataset
TerritoryDataSet ds = new TerritoryDataSe();

foreach(GridViewRow grdRow in grid.Rows)
{
TerritoryDataSet.TerritoryRow terrRow= ds.Torritory.NewTerritoryRow();
terrRow.Column1 row.Cells[0];
..............
ds.Territory.AddTerritoryRow(terrRow);
}

//
update the dataset.

I think this helps...
or please explain where you are struggling?
 
Share this answer
 
Comments
madhuri from hyd 14-Sep-11 3:22am    
hi thank u for your replay.
actually in ths form the dataset is converted to xml and then send to stored procedure in oracle database my problem is how to send to sp and then how to insert the data in table.
i think it is done using cursors but i don't know how to use xml in sp in oracle. please send me one example using xml
thank u
ok you can have the parameter as LOB datatype or varchar (if it has small length) and sent to procedures..

ODP.NET has oracleParamter and type you can do it.

in oracle precedure you have to parse the XML. I would suggest to use strongly typed parser. I will try to post few codes after few hours if required...
 
Share this answer
 
Comments
madhuri from hyd 15-Sep-11 9:32am    
OK
Please send me examples

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900