473,669 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modifying Existing Data

Hi everyone,

Using C#, Windows forms. I am trying to learn how to modify existing data
with in MSDE table/fields. If anyone could help me out with my code, I would
appreciate it. My code is as follows:

private void btnEmpModify_Cl ick(object sender, System.EventArg s e)
{
DataTable thisTable = dsModifyRecord. Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
DataRow thisRow = thisTable?????? ?????????

thisRow["EmplNumber "] = txtBoxEmplNumbe r.Text;
thisRow["EmpFName"] = txtBoxEmpFName. Text;
thisRow["EmpLName"] = txtBoxLNName.Te xt;
thisRow["DateModifi ed"] = DateTime.Now.To String();
thisRow["EmployeeNo tes"] = txtBoxEmpNotes. Text;

//& GETTING LOST HERE
dsModifyRecord. Tables["EMPLOYEE"]??????????????
sqlDataAdapter1 .Update(dsModif yRecord, "Employee") ;
}

Thank you all in advance.

MikeY

Nov 15 '05 #1
2 1818
thisRow = thisTable.Rows[indexOfRowToMod ify];

Keep in mind that data shown in any databound control should be in the same
order as in the table, so there's a direct mapping of row indices.

Chris

"MikeY" <mi*******@yaho o.ca> wrote in message
news:eM******** ******@TK2MSFTN GP12.phx.gbl...
Hi everyone,

Using C#, Windows forms. I am trying to learn how to modify existing data
with in MSDE table/fields. If anyone could help me out with my code, I would appreciate it. My code is as follows:

private void btnEmpModify_Cl ick(object sender, System.EventArg s e)
{
DataTable thisTable = dsModifyRecord. Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
DataRow thisRow = thisTable?????? ?????????

thisRow["EmplNumber "] = txtBoxEmplNumbe r.Text;
thisRow["EmpFName"] = txtBoxEmpFName. Text;
thisRow["EmpLName"] = txtBoxLNName.Te xt;
thisRow["DateModifi ed"] = DateTime.Now.To String();
thisRow["EmployeeNo tes"] = txtBoxEmpNotes. Text;

//& GETTING LOST HERE
dsModifyRecord. Tables["EMPLOYEE"]??????????????
sqlDataAdapter1 .Update(dsModif yRecord, "Employee") ;
}

Thank you all in advance.

MikeY

Nov 15 '05 #2
Hi Chris,

Thank you for information.
However this is still a little fuzzey. I will look for an example. Where it
is being fuzzy is that if at run time, if I don't know what row I will be
modifying, then how do I write the syntex for that particular row ahead of
time.

Txs again
MikeY

"Chris Capel" <ch***@nowhere. com> wrote in message
news:e2******** ******@TK2MSFTN GP12.phx.gbl...
thisRow = thisTable.Rows[indexOfRowToMod ify];

Keep in mind that data shown in any databound control should be in the same order as in the table, so there's a direct mapping of row indices.

Chris

"MikeY" <mi*******@yaho o.ca> wrote in message
news:eM******** ******@TK2MSFTN GP12.phx.gbl...
Hi everyone,

Using C#, Windows forms. I am trying to learn how to modify existing data with in MSDE table/fields. If anyone could help me out with my code, I

would
appreciate it. My code is as follows:

private void btnEmpModify_Cl ick(object sender, System.EventArg s e)
{
DataTable thisTable = dsModifyRecord. Tables["Employee"];
//THIS IS WHERE I'M GETTING LOST
DataRow thisRow = thisTable?????? ?????????

thisRow["EmplNumber "] = txtBoxEmplNumbe r.Text;
thisRow["EmpFName"] = txtBoxEmpFName. Text;
thisRow["EmpLName"] = txtBoxLNName.Te xt;
thisRow["DateModifi ed"] = DateTime.Now.To String();
thisRow["EmployeeNo tes"] = txtBoxEmpNotes. Text;

//& GETTING LOST HERE
dsModifyRecord. Tables["EMPLOYEE"]??????????????
sqlDataAdapter1 .Update(dsModif yRecord, "Employee") ;
}

Thank you all in advance.

MikeY


Nov 15 '05 #3

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

Similar topics

0
1019
by: pmud | last post by:
Hi, An ASP.NET project has been DEPLOYED to the WEB SERVER. I modified one of the pages in the DEVELOPMENT SERVER & tried to replace the Existing page in the project (which has already been deployed on WEB SERVER). So I simply replaced the old page with the modified page in the location C:/Inetpub/wwwroot on Web Server But when I try to view the modified through browser I get an error that the resource has been moved. Evn though I...
7
1777
by: Jan Gregor | last post by:
Hello folks I want to apply changes in my source code without stopping jython and JVM. Preferable are modifications directly to instances of classes. My application is a desktop app using swing library. Python solutions also interest me. Solution similiar to "lisp way" is ideal.
6
1901
by: VidalSasoon | last post by:
I have a singleton class that I want to only contain a hashtable. I want to be able to modify this hashtable at will. The problem I am having is each time I try to update the data using the "SetState" method, "_Instance" keeps on getting reset. I have a hard time grasping the idea how a singleton just holds the data... anyway, here's my test code for console if anyone can help. V.
1
3633
by: Novice | last post by:
I'm afraid I will incur the wraith of Mr. Powell on this one - but I did read his #1 FAQ and some others and I still can't figure this out. I created this little c# app. and I have a PictureBox in my Form. I load this image from the filesystem into the PictureBox and then I draw random little lines on the image. Then when I minimize and reopen the application the little lines are gone. Is there a way to save my lines in memory and...
1
2222
by: Max Khitrov | last post by:
Hello everyone, I'm working on a VS .NET add-in that will allow developers to use Subversion software from within the IDE (much like Source Safe). Ideally, I would like for my plug-in to be able to modify icons that are displayed in Solution Explorer based on the file's status. So far I've been able to retrieve data from Solution Explorer using the UIHierarchy and related objects. Those give me access to the contents, but not to the...
3
1500
by: Chris Bingham | last post by:
Hi, I'm learning VB.Net at the moment, and while I'm doing it I'm writing a couple of programs for work! They all work with the same Access Database, but I'm having a problem with modifying existing rows in the database. In this case I have a button that needs to enter the current time into the database as part of an existing record, here's the code I've got so far;
13
2117
by: Robin Becker | last post by:
When young I was warned repeatedly by more knowledgeable folk that self modifying code was dangerous. Is the following idiom dangerous or unpythonic? def func(a): global func, data data = somethingcomplexandcostly() def func(a): return simple(data,a)
6
2294
by: Welie | last post by:
This is sort of a newbie question. I have an access database application. It is split into a backend data file and GUI. I need to make changes to the db schema. The production version of the data file is not accessible to me remotely. Rather than make changes at the client location the best idea seems to be to write a program to do this programaticaly. Just a small exe that the client can download and run which will make the...
2
1012
by: =?Utf-8?B?a2F0aWVq?= | last post by:
Hi have a table of customers in Access and wish to add a primary key and unique customer ID. Have been warned that adding customer ID field will corrupt existing data. Is there a way it can be done?
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6210
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.