Click here to Skip to main content
15,895,423 members
Home / Discussions / C#
   

C#

 
QuestionHow to Pass TableAdapter data to another form's datagrid for modification then return the data to the original TableAdapter Pin
MarkB12330-Apr-09 22:59
MarkB12330-Apr-09 22:59 
AnswerRe: How to Pass TableAdapter data to another form's datagrid for modification then return the data to the original TableAdapter Pin
Christian Graus30-Apr-09 23:49
protectorChristian Graus30-Apr-09 23:49 
Questionload settings.settings in an array and datagrid Pin
Otex30-Apr-09 22:52
Otex30-Apr-09 22:52 
AnswerRe: load settings.settings in an array and datagrid Pin
DaveyM691-May-09 0:13
professionalDaveyM691-May-09 0:13 
GeneralRe: load settings.settings in an array and datagrid Pin
Otex1-May-09 0:36
Otex1-May-09 0:36 
QuestionHow can I create a DataView based on several DataTables? Pin
maoz30-Apr-09 22:32
maoz30-Apr-09 22:32 
AnswerRe: How can I create a DataView based on several DataTables? Pin
Henry Minute1-May-09 1:03
Henry Minute1-May-09 1:03 
QuestionSql Problem!! Pin
Nafiseh Salmani30-Apr-09 21:56
Nafiseh Salmani30-Apr-09 21:56 
I write the following storePrpcedure:

create PROCEDURE [dbo].[Ins_Products] 
	-- Add the parameters for the stored procedure here
	@ProductName nvarchar(max),
	@ProductModel nvarchar(max),
	@ProductColor nvarchar(50),
	@ProductDescription nvarchar(max),
	@ProductPrice bigint,
	@ProductQuantity int


AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
declare @ProductID  bigint;
--set @ProductID=-1

	if Not Exists ( Select @ProductID = ProductID From Products 
					Where ProductModel=@ProductModel)
	Begin
		Insert Into Products (ProductName,ProductModel,ProductColor,ProductDescription,ProductPrice,ProductQuantity)
		Values(@ProductName,@ProductModel,@ProductColor,@ProductDescription,@ProductPrice,@ProductQuantity)
	    select @ProductID=@@Identity
	End
	else
	
	Begin
		Update Products 
			Set ProductName=@ProductName ,ProductModel=@ProductModel ,
				ProductColor=@ProductColor,
				ProductDescription=@ProductDescription,
				ProductPrice=@ProductPrice,ProductQuantity=@ProductQuantity
			where (ProductID=@ProductID)
	End
return @ProductID
END


but it couse error:

Msg 102, Level 15, State 1, Procedure Ins_Products, Line 26
Incorrect syntax near '='.
Msg 156, Level 15, State 1, Procedure Ins_Products, Line 33
Incorrect syntax near the keyword 'else'.


what should I do?!!
?!!!!!

modified on Friday, May 1, 2009 4:10 AM

AnswerRe: Sql Problem!! Pin
Abhijit Jana30-Apr-09 22:51
professionalAbhijit Jana30-Apr-09 22:51 
AnswerRe: Sql Problem!! Pin
fly90430-Apr-09 23:21
fly90430-Apr-09 23:21 
QuestionString to Dataset? Pin
nabilg30-Apr-09 21:28
nabilg30-Apr-09 21:28 
AnswerRe: String to Dataset? Pin
HuntingWabbits30-Apr-09 23:28
HuntingWabbits30-Apr-09 23:28 
AnswerRe: String to Dataset? Pin
Mycroft Holmes1-May-09 2:21
professionalMycroft Holmes1-May-09 2:21 
QuestionGreat NMS tool Pin
gvgohome30-Apr-09 16:50
gvgohome30-Apr-09 16:50 
AnswerRe: Great NMS tool Pin
Christian Graus30-Apr-09 19:14
protectorChristian Graus30-Apr-09 19:14 
QuestionAsk about table in C#? Pin
Johnscorta30-Apr-09 15:58
Johnscorta30-Apr-09 15:58 
AnswerRe: Ask about table in C#? Pin
_Maxxx_30-Apr-09 16:33
professional_Maxxx_30-Apr-09 16:33 
GeneralRe: Ask about table in C#? Pin
Johnscorta30-Apr-09 18:00
Johnscorta30-Apr-09 18:00 
GeneralRe: Ask about table in C#? Pin
Johnscorta30-Apr-09 18:18
Johnscorta30-Apr-09 18:18 
GeneralRe: Ask about table in C#? Pin
_Maxxx_30-Apr-09 19:47
professional_Maxxx_30-Apr-09 19:47 
QuestionHashtable problem in VisualStudio 08 C# Pin
msheekhah30-Apr-09 14:43
msheekhah30-Apr-09 14:43 
AnswerRe: Hashtable problem in VisualStudio 08 C# Pin
Member 103390730-Apr-09 22:35
Member 103390730-Apr-09 22:35 
GeneralRe: Hashtable problem in VisualStudio 08 C# Pin
msheekhah30-Apr-09 22:43
msheekhah30-Apr-09 22:43 
GeneralRe: Hashtable problem in VisualStudio 08 C# Pin
Member 103390730-Apr-09 23:05
Member 103390730-Apr-09 23:05 
GeneralRe: Hashtable problem in VisualStudio 08 C# Pin
msheekhah30-Apr-09 23:05
msheekhah30-Apr-09 23:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.