473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update metod doesnt work !!

5 New Member
hi all.
i using some text box for input value and some localvarible for passing this data to dataset . give instance for correct row of dataset and data in data table . use one gird view for showing curent data in dataset . in end i am calling update metod to insert data in sql database but this metod doesnt work correctly.
at all doesnt work. but givenot any error .
fill data from my database (work propebly)
Expand|Select|Wrap|Line Numbers
  1.    this.registerTableAdapter.Fill(this.register._Register);
Expand|Select|Wrap|Line Numbers
  1. string Fname = txtFname.Text;
  2.                 string Lname = txtLname.Text;
  3.                 string Email = txtEmail.Text;
  4.                 string SerialNumber = txtSerilNumber.Text;
  5.                 City = comboBoxCity.SelectedItem.ToString(); 
  6.                 Boolean Male = radioButtonMale.Checked;
  7.                 if (SerialNumber != string.Empty )
  8.                 {
  9.                     UpDate(Fname, Lname, Email,  City, SerialNumber, Male);
  10.                 }
  11.  private void UpDate(string Fname, string Lname, string Email, string City, string SerialNumber, bool Male)
  12.         {
  13.             Register.RegisterRow NewRow = register._Register.NewRegisterRow();
  14.             NewRow.Fname= Fname;
  15.             NewRow.Lname = Lname;
  16.             NewRow.City= City;
  17.             NewRow.SerialNumber= SerialNumber;
  18.             NewRow.Male= Male;
  19.             NewRow.Acitivation = true;
  20.             NewRow.sendMail = true;
  21.             NewRow.Email = Email;
  22.             NewRow.SerialNumber = SerialNumber;
  23.             try
  24.             {       
  25.                 register._Register.AddRegisterRow(NewRow);
  26.             }
  27.             catch(Exception ex)
  28.             { }
  29.  
i try to add my data exacly to database via this cod :
Expand|Select|Wrap|Line Numbers
  1.  //registerTableAdapter.Insert(1, SerialNumber, "", "", true, "", true, "", true, "", "", DateTime.Now);
but dont work.
please help me.
thank you ,saeid.
Apr 9 '08 #1
1 1596
Plater
7,872 Recognized Expert Expert
What do you mean by "doesn't work"?
Was there an error message?
What are the columns of your table?
Are you sure your columns are in the right order?
Does it compile?
Are there any warnings?


Generally you add new rows to your DataTable(DataS et), not the DataAdapter?
Apr 9 '08 #2

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

Similar topics

6
8398
by: David | last post by:
I have the following SQL which gives me the row Im after SELECT * FROM staff, staffemails WHERE staff.users_username='$user' and staff.staff_id = staffemails.staff_id thing is I now want to perform an update on the result of this query. Ive tried UPDATE staffemails
0
1349
by: Raja | last post by:
I have a lookup table that holds two columns - a key value and another column containing items. For e.g. Col1 Col2 1 10 1 15 1 12 2 20 2 15 Anohter table has to be updated with col1 and the max value of col2
2
7495
by: Fons Roelandt | last post by:
Heelo, I have to Update all fields from a table with the values of a related table, i've tried some querys i found on the internet, but nothing seems to word, i even tried to lookup the value using dlookup, but even that doesnt seem to word in a update query. The query that i think should work is this one: UPDATE tblOrderLines AS tblO
1
1833
by: luna | last post by:
trying to create an update/insert button basically if the record exists in the database i want to do an update if it doesnt exist i want to create a new record using insert all using the same button my code (which is a mess from playing around!) (this is a test page im playing with) ID in the database is auto increment just cant seem to get anything to work (id rather have it checking the database for the exisitence of an ID rather
5
1470
by: Adam Stachura | last post by:
How can I add a description of metod as it would be desplayed by Intellisense? -- ------------------------------------------------------------ Adam Stachura MCP ------------------------------------------------------------
5
2599
by: devi | last post by:
hi, I am creating a simple bug tracker application (in Access db) and i created a hisotry table to log the bug history. The history table contains details like ProblemRecordNo (PRN), RecordStatus, Assignee, Reporter (and also some more columns). The PK for this table is ID. It contains multiple entries for a Record.
15
1816
by: Scotty | last post by:
I like to have a good insert, update and delete code The code below sometimes workl ok sometimes doesnt work, what i am doing wrong?? Sub SaveAny() Dim command_builder As New OleDb.OleDbCommandBuilder(daOrders) ' Save any changes.
1
2297
by: geeteshss | last post by:
Dear all, actually i spent a whole month on the R&D of datagrid edit ,update,cancel events but recently my guide told me to make it user friendly because no user would like to go on searching rows and columns in a datagrid if there are number of rows and columns.so in my web page i have got two labels two textboxes and three buttons namely add update and delete so when i click on the add button the data is added to datagrid and also displayed...
1
1595
JustRun
by: JustRun | last post by:
I have a problem with the select option at the gridview and gonna pull my hair out cause it doesn't work at all. Here is the Grid view code: I want to get the selected row when the user click "Select" I think it might related to the database Table !! <asp:SqlDataSource ID="sdsCustomer" runat="server" ConflictDetection="CompareAllValues" ConnectionString="Data Source=.;Initial Catalog=TimeSheet;Integrated...
0
9568
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...
1
9335
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,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
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
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
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
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.