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

DataSet Property not re binding to datagrid

I have declared a DataSet Property on by base winform control as
follows:

public DataSet MessageDs
{
get
{
return messageDs;
}
set
{
messageDs = value;
}
}

i then use this on my child control to bind to a datagrid

dgMsgTags.SetDataBinding(this.MessageDs, "MsgTags");

My problem is it only binds the first time. If I change data in the
dataset and try to rebind to an already bound datagrid it just does
nothing the data stays the same but it does not throw an exception. I
can updated the datagrid if I just use another Dataset and do not use
the property but this is not what I want to do.

I change the data in the Dataset as follows:

DataSet dsTags = this.SQLService.GetDS(strSQL);
DataTable dtTags = dsTags.Tables[0].Copy();

//Update DataSet Property
for(int intIdx=0; intIdx < this.MessageDs.Tables.Count; intIdx++)
{
// Remove Message Tags Data Table

if(this.MessageDs.Tables[intIdx].TableName.Equals("MsgTags"))
{
this.MessageDs.Tables.RemoveAt(intIdx);
this.MessageDs.Tables.Add(dtTags);
this.MessageDs.Tables[intIdx].TableName = "MsgTags";
}
}

The above code seems to work fine and puts the expected data in the
dataset for me, it just won't re-bind to the datagrid.

Anyone any ideas?

Thanks in Advance,

Nick
Nov 15 '05 #1
0 1082

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave | last post by:
I tried posting this in the WinForm forum and got no hits so I am trying it here. After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row...
0
by: GrumpyDev | last post by:
Hi. My question is regarding binding a DataSet to a DataGrid. When I change Caption property of all column in my dataset and then bind dataset to a DataGrid, new caption aren't displayed in a grid...
1
by: Trond | last post by:
I have a class MessageController that has a method GetMessagesDataset that connects to a database SPROC. When done it returns a dataset. Then in my ASP.NET for i do this: msgController = new...
8
by: Dan Keeley | last post by:
Hi, I have a dataset which is used to populate my datagrid something like this: My question is, how do I add a caluclated display column to the datagrid? It will be based on ScoreCardScore... ...
1
by: Geraldine Hobley | last post by:
Hello, I have a problem whereby I have a datagrid and and extra field all bound to the same dataset. I can easily edit rows in the dataset by changing the bindingposition in the...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
3
by: serge calderara | last post by:
Dear all, Does anyone know how to bind a System.Collection.ArraysList object to a Dataset ? Thanks for your reply Regards Serge
0
by: bh | last post by:
Using the pubs database, for testing, and example, I'm trying to bind a datagrid that draws data from multiple tables to use for updating multiple rows at once. For my example, I want to display...
4
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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...

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.