Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying to
figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data
with in my DB/MSDE. In general, I have textbox's filled with existing data
from my "Employee" table. I have amongst other buttons, an "Update" button.
Where, when viewing, if I want to change ie the persons name, anyother
field, or all fields I want to press the update button. However I am getting
lost. My code is below with the 3 fields I want to update. Mapping is in the
correct order. Hopefully someone can help by providing correct code or a
link example.
private void btnEmpModify_Click(object sender, System.EventArgs e)
{
DataTable thisTable = dsModifyRecord.Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text;
thisRow["EmpLName"] = txtBoxLNName.Text;
thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE
dsModifyRecord.Tables["EMPLOYEE"]??????????????
sqlDataAdapter1.Update(dsModifyRecord, "Employee");
}
Thank you all in advance
MikeY 4 3562
Hi Mike,
DataTable can contain many rows, you have to select the one that you want to
update.
When you read your data froom the database, it returns several records, one
record, or no records.
How do you fill the text box with your data? Which record from your
DataTable are you using? co**************@yahoo.com
"MikeY" <mi*******@yahoo.ca> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl... Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying
to figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data with in my DB/MSDE. In general, I have textbox's filled with existing data from my "Employee" table. I have amongst other buttons, an "Update"
button. Where, when viewing, if I want to change ie the persons name, anyother field, or all fields I want to press the update button. However I am
getting lost. My code is below with the 3 fields I want to update. Mapping is in
the correct order. Hopefully someone can help by providing correct code or a link example.
private void btnEmpModify_Click(object sender, System.EventArgs e) { DataTable thisTable = dsModifyRecord.Tables["Employee"]; //THIS IS WHERE I'M GETTING LOST thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text; thisRow["EmpLName"] = txtBoxLNName.Text; thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE dsModifyRecord.Tables["EMPLOYEE"]?????????????? sqlDataAdapter1.Update(dsModifyRecord, "Employee"); }
Thank you all in advance
MikeY
Hi Mike,
DataTable can contain many rows, you have to select the one that you want to
update.
When you read your data froom the database, it returns several records, one
record, or no records.
How do you fill the text box with your data? Which record from your
DataTable are you using? co**************@yahoo.com
"MikeY" <mi*******@yahoo.ca> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl... Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying
to figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data with in my DB/MSDE. In general, I have textbox's filled with existing data from my "Employee" table. I have amongst other buttons, an "Update"
button. Where, when viewing, if I want to change ie the persons name, anyother field, or all fields I want to press the update button. However I am
getting lost. My code is below with the 3 fields I want to update. Mapping is in
the correct order. Hopefully someone can help by providing correct code or a link example.
private void btnEmpModify_Click(object sender, System.EventArgs e) { DataTable thisTable = dsModifyRecord.Tables["Employee"]; //THIS IS WHERE I'M GETTING LOST thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text; thisRow["EmpLName"] = txtBoxLNName.Text; thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE dsModifyRecord.Tables["EMPLOYEE"]?????????????? sqlDataAdapter1.Update(dsModifyRecord, "Employee"); }
Thank you all in advance
MikeY
Hi Codewriter,
I fill my textbox's with a sql datareader. What I do is a search for a
particular field. If the field is found, I output the info to textbox's but
I wanted to have the ability to mdofiy, ie persons first name if needed. A
sample of my code is as follows for the datareader/search:
try
{
string userinput = txtBoxEmpSearch.Text;
sqlConnection1.Open();
string select = "SELECT * FROM Employee WHERE (EmpID = '" + userinput +
"')";
SqlCommand cmd = new SqlCommand(select, sqlConnection1);
SqlDataReader myReader = cmd.ExecuteReader();
while(myReader.Read())
{
returnedValue = myReader.GetString(1);
userIDOutPut = Convert.ToString(myReader.GetInt32(0));
userFNameOutPut = myReader.GetString(1);
userLNameOutPut = myReader.GetString(2);
userTitleOutPut = myReader.GetString(3);
txtBoxtmp.Text = myReader.GetString(3); //Temp for Deletion
}
Thanks for help.
"codewriter" <co**************@yahoo.com> wrote in message
news:VE********************@news20.bellglobal.com. .. Hi Mike,
DataTable can contain many rows, you have to select the one that you want
to update. When you read your data froom the database, it returns several records,
one record, or no records. How do you fill the text box with your data? Which record from your DataTable are you using? co**************@yahoo.com
"MikeY" <mi*******@yahoo.ca> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying to figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data with in my DB/MSDE. In general, I have textbox's filled with existing
data from my "Employee" table. I have amongst other buttons, an "Update" button. Where, when viewing, if I want to change ie the persons name, anyother field, or all fields I want to press the update button. However I am getting lost. My code is below with the 3 fields I want to update. Mapping is in the correct order. Hopefully someone can help by providing correct code or a link example.
private void btnEmpModify_Click(object sender, System.EventArgs e) { DataTable thisTable = dsModifyRecord.Tables["Employee"]; //THIS IS WHERE I'M GETTING LOST thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text; thisRow["EmpLName"] = txtBoxLNName.Text; thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE dsModifyRecord.Tables["EMPLOYEE"]?????????????? sqlDataAdapter1.Update(dsModifyRecord, "Employee"); }
Thank you all in advance
MikeY
Hi Codewriter,
I fill my textbox's with a sql datareader. What I do is a search for a
particular field. If the field is found, I output the info to textbox's but
I wanted to have the ability to mdofiy, ie persons first name if needed. A
sample of my code is as follows for the datareader/search:
try
{
string userinput = txtBoxEmpSearch.Text;
sqlConnection1.Open();
string select = "SELECT * FROM Employee WHERE (EmpID = '" + userinput +
"')";
SqlCommand cmd = new SqlCommand(select, sqlConnection1);
SqlDataReader myReader = cmd.ExecuteReader();
while(myReader.Read())
{
returnedValue = myReader.GetString(1);
userIDOutPut = Convert.ToString(myReader.GetInt32(0));
userFNameOutPut = myReader.GetString(1);
userLNameOutPut = myReader.GetString(2);
userTitleOutPut = myReader.GetString(3);
txtBoxtmp.Text = myReader.GetString(3); //Temp for Deletion
}
Thanks for help.
"codewriter" <co**************@yahoo.com> wrote in message
news:VE********************@news20.bellglobal.com. .. Hi Mike,
DataTable can contain many rows, you have to select the one that you want
to update. When you read your data froom the database, it returns several records,
one record, or no records. How do you fill the text box with your data? Which record from your DataTable are you using? co**************@yahoo.com
"MikeY" <mi*******@yahoo.ca> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying to figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how to modify existing data with in my DB/MSDE. In general, I have textbox's filled with existing
data from my "Employee" table. I have amongst other buttons, an "Update" button. Where, when viewing, if I want to change ie the persons name, anyother field, or all fields I want to press the update button. However I am getting lost. My code is below with the 3 fields I want to update. Mapping is in the correct order. Hopefully someone can help by providing correct code or a link example.
private void btnEmpModify_Click(object sender, System.EventArgs e) { DataTable thisTable = dsModifyRecord.Tables["Employee"]; //THIS IS WHERE I'M GETTING LOST thisTable.Rows[??????????????];
thisRow["EmpFName"] = txtBoxEmpFName.Text; thisRow["EmpLName"] = txtBoxLNName.Text; thisRow["EmpTitle"] = txtBoxEmpTitle.Text;
//& GETTING LOST HERE dsModifyRecord.Tables["EMPLOYEE"]?????????????? sqlDataAdapter1.Update(dsModifyRecord, "Employee"); }
Thank you all in advance
MikeY
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
...
|
by: Paul J Lay |
last post by:
|
by: MikeY |
last post by:
Hi everyone,
I have posted earlier this week, but I'm still scratching my head trying to
figure out how to change/modify my data back to my db.
Using C# Windows forms. I am trying to learn how...
|
by: 4 |
last post by:
Insert/Delete/Modify Statement Shortcuts??? Help!!
I am working in C# and running an Oracle 9i server. I was just
wonering if there is a shortcut way of updating my tables and not have to...
|
by: Alpha |
last post by:
I have a Window based application that shows up still running in the task
manager when I close it. It reaches the "this.close" statement and then it
stops at the "}" at the section of the...
|
by: casper christensen |
last post by:
Hi
I run a directory, where programs are listed based on the number of
clicks they have recieved. The program with most clicks are placed on
top and so on. Now I would like people to be apple to...
|
by: gunimpi |
last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431
********************************************************
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help
wanted...
|
by: Shogun |
last post by:
Hey guys, i'm trying to do a confirmation msgbox asking the user if he's sure about updating his database. The problem is... wathever the answer (Yes/No), the database is updated anyway! My code is...
|
by: Mike Copeland |
last post by:
I'm having difficulty updating map objects. In the code I've
excerpted below, I store map objects without difficulty, but my attempts
to modify elements of the stored data don't work.
struct...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |