473,394 Members | 1,721 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,394 software developers and data experts.

currencymanager dataset gridview

private void button2_Click(object sender, EventArgs e)
{
//Search Button
.
.
.
PA_Assets.Assets myassets = new PA_Assets.Assets();//new Asset (webservice) class
PA_Assets.Filters myfilters = new PA_Asset

DataSet source = myassets.GetFilteredAssets(myfilters);//set dataset to database
dataGridView1.DataSource = source.Tables[0]; //set grid to dataset
.
.
.
}




private void button1_Click(object sender, EventArgs e)
{
//Update Button
PA_Assets.Assets myassets = new PA_Assets.Assets();
DataSet source = ((DataTable)dataGridView1.DataSource).DataSet;


PA_Assets.PA_RETURN_CODE result;
result = myassets.UpdateAssets(source);


//DataSet ds = myassets.GetAllAssets();//why doesn't this work??
//Why do we have to bind this new dataset w/ the dataGridView1??

MessageBox.Show("Items updated successfully");
}


Hi, could someone please explain why i have to bind the new dataset to the dataGridView1 in order for my program to work, e.g.

DataSet ds = myassets.GetAllAssets();//new refreshed dataset
((DataTable)DataGridView1.DataSource).Dataset = ds;


I think it has to do a lot with currencymanager, but i can't figure out how it works, thanx.
Jan 16 '08 #1
0 861

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

Similar topics

1
by: Kevin | last post by:
Hi Al When I have a text box, list box, and a datagrid, how does a CurrencyManager relate to all these controls(seeing as though the datagrid uses Complex binding and textbox and list box use...
1
by: Pete Davis | last post by:
I have written a custom databound grid control that we've been using successfully for months, but one of our developers has just run into a problem that I can't figure out. The code for setting...
10
by: D | last post by:
hi I have a form with 2 datagrids showing related table data in a master / child or order / order details type relationship. I would like to auto select the row in the order details table which...
2
by: Rich | last post by:
Hello, I have a datagrid (dgr1) on a form and I'm trying to bind a currencyManager Object (cma) to it and print the current row position. But all I get for cma.Position is 0, 0, 0 for any row...
1
by: SomebodyElse | last post by:
Hi. Apologies if this has been asked here before - I've searched & searched but can't find anything. It's probably my serach parameters, but I'm having trouble even describing it to a search...
4
by: Justin | last post by:
I'm just learning ASP.NET 2.0 and everything I find on Datasets including the MSPress book I bought go way to far for what I need. I do not need to bind a datasource. My source will be a text...
1
by: rn5a | last post by:
I was using a DataView to bind records from a DB table to a DataGrid using the following code: Dim sqlDapter As SqlDataAdapter Dim dSet As DataSet Dim dView As DataView sqlDapter = New...
1
by: back100y | last post by:
I have an application where I am using a DataGridView control to display DataTables stored in a DataSet. What I need to do is be able to prevent a user from adding a new if there is already a...
0
by: cmrhema | last post by:
Hi, I have a gridview problem while binding more than two gridviews. I am giving a sample scenario of what I have done so far I have two tables First table: Department , having columns...
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.