Click here to Skip to main content
15,915,508 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: big problem: Validating the items in a listbox Pin
ctoma200524-Aug-07 4:02
ctoma200524-Aug-07 4:02 
GeneralRe: big problem: Validating the items in a listbox Pin
Luc Pattyn24-Aug-07 4:17
sitebuilderLuc Pattyn24-Aug-07 4:17 
Questionextracting data from the datagridview Pin
helloise20-Aug-07 21:16
helloise20-Aug-07 21:16 
AnswerRe: extracting data from the datagridview Pin
Giorgi Dalakishvili20-Aug-07 21:42
mentorGiorgi Dalakishvili20-Aug-07 21:42 
Questionchar distribution in office document Pin
czyhsoul20-Aug-07 2:31
czyhsoul20-Aug-07 2:31 
QuestionConnecting a data field to a TextBox Pin
virtual_jpr19-Aug-07 21:56
virtual_jpr19-Aug-07 21:56 
AnswerRe: Connecting a data field to a TextBox Pin
Christian Graus20-Aug-07 0:56
protectorChristian Graus20-Aug-07 0:56 
QuestionmySqlDataAdapter.Update(myDataSet, "Staff"); not updating my DB Pin
helloise19-Aug-07 21:43
helloise19-Aug-07 21:43 
can anyone help me with this please.
thank you.
it is in visual studio 2005

public void OKbutton_Click(object sender, EventArgs e)
{
SqlConnection mySqlConnection = new SqlConnection("server=ISS\\SQLEXPRESS;database=Staff;uid=sa;pwd=xbcprfly");
mySqlConnection.Open();

SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter("SELECT Lastname, Firstname, TelephoneExtension FROM Staff ORDER BY Lastname",mySqlConnection);

DataSet myDataSet = new DataSet();

string insertQuery = "insert into Staff values (LastnameTextBox.Text,FirstnameTextBox.Text,TelExtTextBox.Text)";

//mySqlDataAdapter.SelectCommand = new SqlCommand(insertQuery, mySqlConnection);
mySqlDataAdapter.InsertCommand = new SqlCommand(insertQuery, mySqlConnection);

SqlParameter workParam = null;

workParam = mySqlDataAdapter.InsertCommand.Parameters.Add(LastnameTextBox.Text, SqlDbType.NVarChar, 80, "Lastname");
workParam = mySqlDataAdapter.InsertCommand.Parameters.Add(FirstnameTextBox.Text, SqlDbType.NVarChar, 80, "Firstname");
workParam = mySqlDataAdapter.InsertCommand.Parameters.Add(TelExtTextBox.Text, SqlDbType.NVarChar, 50, "TelephoneExtension");

//SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(mySqlDataAdapter);
//mySqlDataAdapter.Fill(myDataSet, "Staff");
//mySqlDataAdapter.UpdateCommand = "Staff";

mySqlDataAdapter.TableMappings.Add("Staff", "Staff");

try
{
mySqlDataAdapter.Update(myDataSet, "Staff");
//int noOfRowsDs = mySqlDataAdapter.Fill(myDataSet, "Staff");
Application.DoEvents();
MessageBox.Show("data set updated");
}

catch (Exception f)
{
MessageBox.Show(f.ToString());
}

//SqlCommand cmd = new SqlCommand(cmdStr, con);
//cmd.ExecuteNonQuery();

this.Close();
}
AnswerRe: mySqlDataAdapter.Update(myDataSet, "Staff"); not updating my DB Pin
Rocky#20-Aug-07 1:47
Rocky#20-Aug-07 1:47 
QuestionForms with only a Menu Bar Pin
TyrionTheImp19-Aug-07 19:49
TyrionTheImp19-Aug-07 19:49 
AnswerRe: Forms with only a Menu Bar Pin
kubben20-Aug-07 3:46
kubben20-Aug-07 3:46 
GeneralRe: Forms with only a Menu Bar Pin
TyrionTheImp20-Aug-07 18:38
TyrionTheImp20-Aug-07 18:38 
GeneralRe: Forms with only a Menu Bar Pin
kubben21-Aug-07 1:41
kubben21-Aug-07 1:41 
GeneralRe: Forms with only a Menu Bar Pin
TyrionTheImp29-Aug-07 3:40
TyrionTheImp29-Aug-07 3:40 
QuestionPreferred "updating" paradigm with WinForms Pin
martin_hughes19-Aug-07 4:11
martin_hughes19-Aug-07 4:11 
AnswerRe: Preferred "updating" paradigm with WinForms Pin
richardw4819-Aug-07 4:49
richardw4819-Aug-07 4:49 
Question::IsDialogMessage Makes the program stuck Pin
yytg18-Aug-07 10:45
yytg18-Aug-07 10:45 
QuestionNeed starting advice for an gui (screenshot inside) Pin
naal1118-Aug-07 2:31
naal1118-Aug-07 2:31 
AnswerRe: Need starting advice for an gui (screenshot inside) Pin
Lutosław28-Aug-07 3:35
Lutosław28-Aug-07 3:35 
QuestionUrgent Setup Problems .NET 2005 Pin
Elizma17-Aug-07 5:01
Elizma17-Aug-07 5:01 
AnswerRe: Urgent Setup Problems .NET 2005 Pin
Paul Conrad27-Oct-07 11:30
professionalPaul Conrad27-Oct-07 11:30 
GeneralRe: Urgent Setup Problems .NET 2005 Pin
Elizma28-Oct-07 20:08
Elizma28-Oct-07 20:08 
GeneralRe: Urgent Setup Problems .NET 2005 Pin
Paul Conrad29-Oct-07 12:54
professionalPaul Conrad29-Oct-07 12:54 
QuestionI want pc to access my windows application over the network Pin
Tomic16-Aug-07 23:26
Tomic16-Aug-07 23:26 
AnswerRe: I want pc to access my windows application over the network Pin
kubben17-Aug-07 1:59
kubben17-Aug-07 1:59 

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.