473,387 Members | 1,899 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,387 software developers and data experts.

Programming error

2
object upt;
myconn.Open();
mycmd = new SqlCommand("select CId from customer where CId='" + TextBox1.Text + "'", myconn);
upt= mycmd.ExecuteScalar();
string up = Convert.ToString(upt);
if (up == TextBox1.Text)
{
Label7.Text = "Row is Updated";
}
else
{
Label7.Text = "Row is not Updated";
}
mycmd = new SqlCommand("update customer set CName='" + TextBox2.Text + "',CAddress='" + TextBox3.Text + "',CPhone='" + TextBox4.Text + "',CEmail='" + TextBox5.Text + "',CCCardNo='" + TextBox6.Text + "'where CId='"+TextBox1.Text+"'", myconn);
mycmd.ExecuteNonQuery();
myconn.Close();
display();
clear();
i write this code in button click event.When data is updated,

label shows "Row is not Updated". But actually it has to show "Row is Updated" msg.


But record is updated. It is showing msg only wrong. Please give me a

solution for this ASAP. Though condition is correct, it jumped to else. I'm getting confused. Anybody please help me.
Feb 25 '08 #1
0 718

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

Similar topics

65
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are...
4
by: Ian Lazarus | last post by:
Greetings, Is there a consensus as to the best way to report a programming error, for example an out of bounds index value passed to a function? There are three approaches that I can think of: ...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
1
by: Irritable Bowel Syndrome | last post by:
Just finished off a production .NET web application written in c#. I set up a error handler in the global.asax which is triggered to iterate through the error stack and send it and other...
6
by: Martin Ortiz | last post by:
Which is best approach? Should Try + Catch be used to only deal with "catastrophic" events (like divide by zero, non-existant file, etc...etc...) Or should Try + Catch be used IN PLACE of...
81
by: Russ | last post by:
I just stumbled onto PEP 316: Programming by Contract for Python (http://www.python.org/dev/peps/pep-0316/). This would be a great addition to Python, but I see that it was submitted way back in...
270
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting...
29
by: Martin Schmied | last post by:
Dear folks I'm looking for good sites/material for this topic: Introduction to programming, using Javascript. So, not introduction to programming *in" Javascript. Well, I guess this would be...
5
by: mangoxoxo | last post by:
Hey I'm not sure if this is where I should be asking this but I'm going to ask anyway. I'm doing an assignment for my Intro to Comp Programming class. This is the assignment: Define a class...
2
by: Netwatcher | last post by:
Hello, i am new to c++ windows and DX programming, i encountered a code in the book stated in the title, which doesn't work for a reason, here is the code // Beginning Game Programming // Chapter...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
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
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...

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.