ItemNo refno Process Name Qty 001 1 A John 50 001 2 A Jon 150 002 3 B Kalis 100 003 4 A Bob 300 Second Table ItemNo Newrefno Process Name Qty 001 001 ZZ peter 50 001 001/a ZkZ Joe 70 002 002 Ab Ray 100 Result Set 001 A John 200 001/a ZZ ZkZ peter joe 50 70 002 B Kalis 100 002 Ab Null Ray Null 100 Null 003 A Bob 300 null null null null null null null
Here first row of the result set explanation:
up to this 001 A John 200 based on first table sum...
and 001/a zz ZkZ peter joe 50 70
here 001/a newrefno of 001 so i need to show all the ItemNo 001 record in one row like the above resultset.
trying to merge two sets of data from a SqlDataAdapter and an OleDataAdapter and then populate a gridview on a button click. If I run just the SqldataAdapter on its own the grid populates as expected. This also applies to the OleDataAdapter. The problem arises when I try to merge the two. I get an empty table, hence dt3 is not populating. The code i'm using is below.Does anyone know why this doesn't work?
Could I receive datatable or datarow as objectDataSource update function parameter? I need it because I need the datarow verison functionality to detect change for a column in the update function logic.this is what i had tried:
After I setup the update function in the ObjectDataSource , its DataObjectTypeName has a funny name
How do I sort a data table based on a particular column which has integer values in ascending order?
I wrote this:
leadtable.DefaultView.Sort = "Id"
But it doesnt seem to work, it displays fine but when i get try to get the values of the sorted datatable in an array they dont come in an sorted ordere Datatble is defined as:view plaincopy to clipboardprint?
I have a DataSet comprised of two DataTables. One of the DataTables is further comprised of the results of two different SQL calls. I need to alphabetize the results of those SQL calls. After the seconds set of results is added to the DataTable I tried the following but the end result (displayed on the page) did not alphabetize the returned results. There was no error. Can anyone advise me please. 'programs' is the DataTable name, title is the column name.
iam working with gridview in asp.net3.5,Sqlserver2008 I am retrieving data from a SP into a datatable.i need to store this table into gridview. but am getting the last row from my datatable into my gridview.
In tbl1 I am writing client's name, phonenumber. tbl1 also has auto increment column whose value is extracted by using SCOPE_IDENTITY.
Now here is the problem, I have DataTable "dtbl" which I have to write to tbl2, this dtbl can have any number or rows. What is the best way to write the whole dtbl to tbl2.Also I have to do RollBack if any error occurs. Here is the flow which I have to achieve..
System Status = CURRENT
*write clients to tbl1 (get Identity column value)
*write dtbl to tbl2 (in case of any error, rollback to System Status = CURRENT)