2
Answers

How to insert different records into multiple sql tables with same uniqueidentifier in sql server

roy himanshu

roy himanshu

15y
4.2k
1

declare @myKey uniqueidentifier
select

@myKey
= newId()
insert
into persons (id,lastname,firstname)
values
(@myKey,'hai','world')
 

insert
into persons1(id,c1,c2)
values
(@myKey,'hello','roy')
 
hi,this is my code.but still now iam getting error.the error message also i pasted here.plz rectifie my problem,plz.iam faceing this problem since several hours.plz help me.  the error message is
Msg 206, Level 16, State 2, Line 5
Operand type clash: uniqueidentifier is incompatible with int
Msg 206, Level 16, State 2, Line 9
Operand type clash: uniqueidentifier is incompatible with int
Answers (2)
0
Kirtan Patel
NA 35k 2.8m 15y
Suppose you haveing Project A and Project B

then in Solution Explorer Right Click Project A and >>> Add Reference >> Project Tab >> select Project and Click ok
 





then you can call Another Project's Form like below Code

here i m calling Application19 's form in Load Event of Application18 Form1

 private void Form1_Load(object sender, EventArgs e)

        {

            WindowsFormsApplication19.Form1 f1 = new WindowsFormsApplication19.Form1();

            f1.Show();

        }


check "Do you like this answer" of it helpes you :)


Accepted
0
jinge
NA 2.4k 23.5k 15y

Hello guy,
 
If you want to see the form in Design time, just double click the Form node in the solution explorer.
 
If you want to show the form in runtime, then you can instantiate a new instance of that form, and invoke Show or ShowDialog method of that object to open this form
 
Let me know if it helps.
0
naura pax
NA 1.9k 64.8k 15y

hi,
You'll first have to add reference of the new project in your existing project by right clicking on existing window project in solution explorer and selecting add reference.
Then you can just call formName.Show/ShowDialog method, but don't forget to use namespace of new project.