Click here to Skip to main content
15,906,816 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionGetting really simple simple-binding to work Pin
Nigel Mackay13-Jun-08 5:21
Nigel Mackay13-Jun-08 5:21 
AnswerRe: Getting really simple simple-binding to work Pin
darkelv13-Jun-08 5:58
darkelv13-Jun-08 5:58 
GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay13-Jun-08 6:11
Nigel Mackay13-Jun-08 6:11 
GeneralRe: Getting really simple simple-binding to work Pin
darkelv16-Jun-08 1:41
darkelv16-Jun-08 1:41 
GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay16-Jun-08 4:46
Nigel Mackay16-Jun-08 4:46 
GeneralRe: Getting really simple simple-binding to work Pin
darkelv16-Jun-08 5:22
darkelv16-Jun-08 5:22 
GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay17-Jun-08 4:18
Nigel Mackay17-Jun-08 4:18 
GeneralRe: Getting really simple simple-binding to work Pin
darkelv16-Jun-08 19:57
darkelv16-Jun-08 19:57 
Well, sorry to tell, the databinding works on dataset, at least on mine. The message box will display the changed value:

private void button1_Click(object sender, EventArgs e)
{
    string s = "user id=sa;password=PASSWORD;initial catalog=DATABASENAME;data source=SERVERNAME;timeout=90";
    IDbConnection con = new System.Data.SqlClient.SqlConnection(s);
    IDbCommand cmd = con.CreateCommand();
    dataSet = new DataSet();
    IDbDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter();

    cmd.CommandText = "Select * from Customers";
    adapter.SelectCommand = cmd;
    adapter.Fill(dataSet);

    if (dataSet.Tables[0].Rows.Count > 0)
    {
        this.textBox1.DataBindings.Add("Text", dataSet, "Table.CompanyName", false, DataSourceUpdateMode.OnPropertyChanged, string.Empty);
        propertyGrid1.SelectedObject = dataSet.Tables[0].Rows[0];
    }
}

private void button2_Click(object sender, EventArgs e)
{
    MessageBox.Show(dataSet.Tables[0].Rows[0]["CompanyName"].ToString());
}

GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay17-Jun-08 4:22
Nigel Mackay17-Jun-08 4:22 
GeneralRe: Getting really simple simple-binding to work Pin
darkelv17-Jun-08 5:20
darkelv17-Jun-08 5:20 
GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay17-Jun-08 5:27
Nigel Mackay17-Jun-08 5:27 
AnswerRe: Getting really simple simple-binding to work Pin
Brady Kelly13-Jun-08 23:52
Brady Kelly13-Jun-08 23:52 
GeneralRe: Getting really simple simple-binding to work Pin
Nigel Mackay14-Jun-08 5:09
Nigel Mackay14-Jun-08 5:09 
QuestionFiltering a DataGridView bound to a BindingSource Pin
K.L.K12-Jun-08 12:45
K.L.K12-Jun-08 12:45 
Questionhi... Pin
SamRST11-Jun-08 2:42
SamRST11-Jun-08 2:42 
AnswerRe: hi... Pin
Giorgi Dalakishvili11-Jun-08 2:49
mentorGiorgi Dalakishvili11-Jun-08 2:49 
GeneralRe: hi... Pin
SamRST11-Jun-08 2:54
SamRST11-Jun-08 2:54 
GeneralRe: hi... Pin
Giorgi Dalakishvili11-Jun-08 3:16
mentorGiorgi Dalakishvili11-Jun-08 3:16 
QuestionGetting File Path Pin
Ajeet mittal11-Jun-08 2:22
Ajeet mittal11-Jun-08 2:22 
AnswerRe: Getting File Path Pin
Colin Angus Mackay11-Jun-08 2:52
Colin Angus Mackay11-Jun-08 2:52 
GeneralRe: Getting File Path Pin
Ajeet mittal11-Jun-08 3:14
Ajeet mittal11-Jun-08 3:14 
GeneralRe: Getting File Path Pin
Ashfield11-Jun-08 4:54
Ashfield11-Jun-08 4:54 
QuestionSpell Checking with C# Pin
RajeswariTholeti11-Jun-08 0:12
RajeswariTholeti11-Jun-08 0:12 
QuestionControl suggestion Pin
N a v a n e e t h10-Jun-08 21:23
N a v a n e e t h10-Jun-08 21:23 
AnswerRe: Control suggestion Pin
dan!sh 10-Jun-08 21:49
professional dan!sh 10-Jun-08 21:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.