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) - this.registerTableAdapter.Fill(this.register._Register);
- string Fname = txtFname.Text;
-
string Lname = txtLname.Text;
-
string Email = txtEmail.Text;
-
string SerialNumber = txtSerilNumber.Text;
-
City = comboBoxCity.SelectedItem.ToString();
-
Boolean Male = radioButtonMale.Checked;
-
if (SerialNumber != string.Empty )
-
{
-
UpDate(Fname, Lname, Email, City, SerialNumber, Male);
-
}
-
private void UpDate(string Fname, string Lname, string Email, string City, string SerialNumber, bool Male)
-
{
-
Register.RegisterRow NewRow = register._Register.NewRegisterRow();
-
NewRow.Fname= Fname;
-
NewRow.Lname = Lname;
-
NewRow.City= City;
-
NewRow.SerialNumber= SerialNumber;
-
NewRow.Male= Male;
-
NewRow.Acitivation = true;
-
NewRow.sendMail = true;
-
NewRow.Email = Email;
-
NewRow.SerialNumber = SerialNumber;
-
try
-
{
-
register._Register.AddRegisterRow(NewRow);
-
}
-
catch(Exception ex)
-
{ }
-
i try to add my data exacly to database via this cod : - //registerTableAdapter.Insert(1, SerialNumber, "", "", true, "", true, "", true, "", "", DateTime.Now);
but dont work.
please help me.
thank you ,saeid.
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?
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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
|
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
|
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
|
by: Adam Stachura |
last post by:
How can I add a description of metod as it would be desplayed by
Intellisense?
--
------------------------------------------------------------
Adam Stachura
MCP
------------------------------------------------------------
| |
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.
|
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.
|
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...
|
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...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |