Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: Find HyperLinks Pin
enjoycrack18-Sep-05 20:25
enjoycrack18-Sep-05 20:25 
AnswerRe: Find HyperLinks Pin
seee sharp18-Sep-05 23:14
seee sharp18-Sep-05 23:14 
QuestionDataGridBoolColumn - event Pin
JuergenLissmann18-Sep-05 18:54
JuergenLissmann18-Sep-05 18:54 
AnswerRe: DataGridBoolColumn - event Pin
deep718-Sep-05 20:10
deep718-Sep-05 20:10 
QuestionCommunication With ports in Visual.NET Pin
samira forooghi18-Sep-05 18:45
samira forooghi18-Sep-05 18:45 
AnswerRe: Communication With ports in Visual.NET Pin
zon_cpp19-Sep-05 6:08
zon_cpp19-Sep-05 6:08 
AnswerRe: Communication With ports in Visual.NET Pin
zon_cpp19-Sep-05 6:08
zon_cpp19-Sep-05 6:08 
QuestionSimple Database Problem Pin
18-Sep-05 16:57
suss18-Sep-05 16:57 
I've been trying to write data to my database, but it seems like the last change I attempt won't work. The database is an Access 2003 file, and uses Jet 4.0 for the provider.

I'm currently only developing an application to write data to one table of the database, "Employees."

Employees Table
-Primary Key: EmployeeID (Employee's SSN, unformatted)
-FirstName
-MiddleInitial
-LastName
-PayRate
-FICA
-SSI
-Tax
-SalesPersonID

It's rudimentary, I know, but I'll work on expanding the database later.

The application I currently use consists of nine textBoxes (textBox1 ... textBox9), two buttons -- a Clear button (button1), and an Update button (button2) -- a dataConnection control (dcFusion), a DataAdapter(daEmployees), and a dataSet(dsEmployees). The form name is Form1.

The textBoxes are data bound to each column in the database, in the order that I've listed them. (i.e. textBox1 is bound to Employees.EmployeeID).

Here's my Update method:
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].EmployeeID = Convert.ToInt32(textBox1.Text);<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].FirstName = textBox2.Text;<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].MiddleInitial = textBox3.Text;<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].LastName = textBox4.Text;<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].PayRate = Convert.ToDecimal(textBox5.Text);<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].FICA = Convert.ToDecimal(textBox6.Text);<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].SSI = Convert.ToDecimal(textBox7.Text);<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].Tax = Convert.ToDecimal(textBox8.Text);<br />
    dsEmployees.Employees[comboBox1.SelectedIndex].SalesPersonID = textBox9.Text;<br />
    dcFusion.Open();<br />
    daEmployees.Update(dsEmployees, "Employees");<br />
    daEmployees.Fill(dsEmployees, "Employees");<br />
    dcFusion.Close();<br />
}


When the dataSet refreshes, the change I enter reverts back to what is already in the database, and no change is made, even after calling the Update method of my dataAdapter. What am I doing wrong here?

-- modified at 23:00 Sunday 18th September, 2005
AnswerRe: Simple Database Problem Pin
KaptinKrunch18-Sep-05 17:12
KaptinKrunch18-Sep-05 17:12 
AnswerRe: Simple Database Problem Pin
KaptinKrunch18-Sep-05 17:14
KaptinKrunch18-Sep-05 17:14 
AnswerRe: Simple Database Problem Pin
FusionCoding19-Sep-05 3:20
FusionCoding19-Sep-05 3:20 
Questiongetting file bytesize Pin
g00fyman18-Sep-05 16:40
g00fyman18-Sep-05 16:40 
AnswerRe: getting file bytesize Pin
Ashok Dhamija18-Sep-05 18:14
Ashok Dhamija18-Sep-05 18:14 
GeneralRe: getting file bytesize Pin
g00fyman18-Sep-05 18:45
g00fyman18-Sep-05 18:45 
GeneralRe: getting file bytesize Pin
g00fyman18-Sep-05 18:50
g00fyman18-Sep-05 18:50 
GeneralRe: getting file bytesize Pin
Ashok Dhamija18-Sep-05 19:12
Ashok Dhamija18-Sep-05 19:12 
QuestionNeed 3 Pens Reg, Green and Blue Pin
Anonymous18-Sep-05 15:04
Anonymous18-Sep-05 15:04 
AnswerRe: Need 3 Pens Reg, Green and Blue Pin
FusionCoding18-Sep-05 17:08
FusionCoding18-Sep-05 17:08 
AnswerRe: Need 3 Pens Reg, Green and Blue Pin
Christian Graus18-Sep-05 17:50
protectorChristian Graus18-Sep-05 17:50 
QuestionDraw larger drawings Pin
radic.feng18-Sep-05 15:00
radic.feng18-Sep-05 15:00 
AnswerRe: Draw larger drawings Pin
radic.feng18-Sep-05 16:51
radic.feng18-Sep-05 16:51 
QuestionProblems with Setup Project Pin
surfman1918-Sep-05 14:29
surfman1918-Sep-05 14:29 
GeneralRe: Problems with Setup Project Pin
seee sharp18-Sep-05 17:44
seee sharp18-Sep-05 17:44 
GeneralRe: Problems with Setup Project Pin
surfman1919-Sep-05 0:03
surfman1919-Sep-05 0:03 
Questionserial number for my application Pin
Sasuko18-Sep-05 12:18
Sasuko18-Sep-05 12:18 

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.