473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

change the existing record

35
hello,


I want to change any of the textbox value and after changing the value when I click on update button record should be reflected into database.

I don't know how it will be done

Thanks..
Jan 12 '07 #1
3 1066
hello,


I want to change any of the textbox value and after changing the value when I click on update button record should be reflected into database.

I don't know how it will be done

Thanks..
Hi Muskan...
i think u can use d update query to edit the database...
u have to give d code inside d update button click event...
for executing update query by code u can have SqlCommand class.
and executenonquery() method of it.

eg:
SqlCommand sqlcmd = new SqlCommand(sqlQuery, connection variale);
sqlcmd.ExecuteNonQuery();
open and close d connection for d operation...
while writing d sqlQuery. do it with some condition like

"update table set cols...... where colname=textboxvalue"

hope this helps...
thanx,
sand..
Jan 12 '07 #2
muskan
35
thanks for reply......

I know this method
but I want to know some other method for update the records

I mean to say........
suppose there 10 textboxes on the form
and I want to change value of more than 5 textboxes then we have to specify all textboxes value in SET clause .

I think this is not the good way to update.This method is fine when only 1 or 2 textboxes on the form

So can u give some other method to update.

thanks.

Hi Muskan...
i think u can use d update query to edit the database...
u have to give d code inside d update button click event...
for executing update query by code u can have SqlCommand class.
and executenonquery() method of it.

eg:
SqlCommand sqlcmd = new SqlCommand(sqlQuery, connection variale);
sqlcmd.ExecuteNonQuery();
open and close d connection for d operation...
while writing d sqlQuery. do it with some condition like

"update table set cols...... where colname=textboxvalue"

hope this helps...
thanx,
sand..
Jan 12 '07 #3
thanks for reply......

I know this method
but I want to know some other method for update the records

I mean to say........
suppose there 10 textboxes on the form
and I want to change value of more than 5 textboxes then we have to specify all textboxes value in SET clause .

I think this is not the good way to update.This method is fine when only 1 or 2 textboxes on the form

So can u give some other method to update.

thanks.
Hi Muskan,
sorry 4 being late...
did u mean the prob that even if u edit only one txtbox then also u will update the whole cols???
can u try it using TextBox1_TextChanged() event?
means within each textbox's change event u will append the query to d string...
ie. first u declare a string to store d string - "update table set "
then within each event append the corresponding textbox value as columns...
here d prob is that it may not look good if there r many no. of textboxes...
hope this helps...
thanx,
sand...
Jan 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rey | last post by:
Howdy, all. Appreciate your help. Have a one to many relation between a client and visit table. In the visit subform, I have a visittype and counselor field which are comboboxes. If I set...
3
by: Sam Gledhill | last post by:
Hi, I'm hoping someone can help me out. I have a database with a form. This form has no recordsource (I'm using it as a complex MsgBox). It has a single textbox of type Date. It also has three...
1
by: Tom Cusick | last post by:
We have a Job Shop database. When I get an order in I put all the line item information into the database. Some orders have multiple lines and most of the information is the same. (eg. Customer...
2
by: Mark Perona | last post by:
I created an ASP.net form with an editable datagrid on it. I can create new records, and update and delete existing records. The problem I have is that I want a field in the grid to be editible...
10
by: Marc R. | last post by:
Hi all, I edit records using a form that have multiple control bind on Dataview, But I don't want to update right always to database, I would like to delay until all Changes (add all new...
5
by: ApexData | last post by:
Hello I'm trying to save data to an Existing Record in a single table. These fields are not on my Form. It is not saving the data to the record ??? Dim db As DAO.Database Dim rs As...
13
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone...
6
by: jcf378 | last post by:
hello-- i am having trouble figuring out how to export individual records from an Access 2002 Form into a pre-existing Excel spreadsheet, such that the exported record is merely appended to the...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
tracyyun
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 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.