16,016,489 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Akashjoshi (Top 7 by date)
Akashjoshi
5-Nov-14 3:29am
View
you just used session over their...
Akashjoshi
5-Nov-14 2:12am
View
Deleted
see solution
Akashjoshi
3-Nov-14 23:52pm
View
Deleted
it's not proper way ...
we can not use IF-Else over their
Akashjoshi
3-Nov-14 23:49pm
View
Use this procedure..
create procedure Email_insert_procedure(@Id int, @Email varchar(100))as
insert into Email values ((select Id from contact WHERE Id=@Id), @Email)
Akashjoshi
3-Nov-14 23:26pm
View
cmd.Parameters.Add("@Id", SqlDbType.Int).Value = "125";
cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = "Mr";
Here you add 125 as a ID
so in insert procedure first it checks that
insert into Email VALUES((select id from contact WHERE Id=125),@email)
If this condition is true then id is inserted into your Email table..
and if condition is wrong then id does't inserted...because ID=125 is not in contact table...
Akashjoshi
3-Nov-14 7:23am
View
Try this...
insert into Email VALUES((select id from contact WHERE Id=@id),@email)
Akashjoshi
3-Nov-14 7:07am
View
your defination is correct but first you insert data into contact table and those data is used in Email table...
Like
insert into contact VALUES(1)
insert into Email VALUES(1,'aka@gmail.com')
Show More