473,398 Members | 2,335 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,398 software developers and data experts.

How to update the data using stored procedures code?

iam using textbox1,textbox2,textbox3 for Empid,Ename,Esalary and iam upadting the data using update button for that im using stored procedure for updating ename esalary and the problem is some times i dont want to update the Ename but i wrote the stored procedure for updating both ename and esalary as well....when iam leaving the textbox2 as empty iam getting the errors so how can i modify my stored procedure with if statement for accepting the previous values also if i laeve textbox as empty
Mar 28 '11 #1
4 1977
If you have empid as the primary key and if you are updating based on the empid ,, u should not get any sort of error, even if you leave the textbox2 or textbox3 empty.......
Mar 28 '11 #2
Rabbit
12,516 Expert Mod 8TB
Build a dynamic SQL string in the stored procedure using the ifs and then execute that. Make sure you sanitize the inputs first.
Mar 28 '11 #3
Hai Rabb, can u plz provide me the solution i.e, procedure with if's for my problem.................
Mar 29 '11 #4
Rabbit
12,516 Expert Mod 8TB
Sorry, we don't provide full solutions here. We can help you get there but we won't do it all for you.
Mar 29 '11 #5

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

Similar topics

0
by: Taras | last post by:
Hello! I have a problem. I'm using a dataset in VB.NET with multiple tables with relations between them. I would like dataset to update to all related tables with right identity, when certain...
2
by: scott | last post by:
Hi, Just wondering what sort of problems and advantages people have found using stored procedures. I have an app developed in VB6 & VB.NET and our developers are starting to re-write some of the...
1
by: Taras | last post by:
Hello! I have a problem. I'm using a dataset in VB.NET with multiple tables with relations between them. I would like dataset to update to all related tables with right identity, when certain...
1
by: nishi.hirve | last post by:
Hello, I am writing one simple application in C# in which i m writing some queries for retriving data from database. Database used is postgeSQL which is used through ODBC. I want to write...
2
by: Dean Slindee | last post by:
Anyone know of a location for a simple example of a web service using stored procedures to Read, Insert, Delete and Update rows in MS SQL Server? Thanks, Dean S
0
by: ccorbett | last post by:
Hi, I am pretty new to microsoft programming environment. I want to create forms in visual basic 2005 studio that read data from stored procedures and load into the forms for editing and new...
3
by: GaryDean | last post by:
In a new 2.0 website I am developing I am using .XSD tableadapters, building them with the wizard), and choosing the Stored Procedure option. I now notice that when I go back to change the sql...
1
by: sunnysrivastava84 | last post by:
how can i search arecord using stored procedures .plz give me the code
1
hariharanmca
by: hariharanmca | last post by:
How to Fetch Data from Database and print it in a Text File with aligenments using Stored Procedures ( Without any Frontend). Thank you
1
by: kanimozhiz | last post by:
Hi Can anyone tell me how to invoke the DALC(Data Access Logic Component) class using stored procedures in C# .net I have created the DALC using stored procedure but I was unable to execute it....
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.