Click here to Skip to main content
15,922,407 members
Home / Discussions / Database
   

Database

 
AnswerRe: what is the shortcut key to open sql management studio in windows Pin
Paul Conrad3-Sep-07 7:53
professionalPaul Conrad3-Sep-07 7:53 
AnswerRe: what is the shortcut key to open sql management studio in windows Pin
Pete O'Hanlon3-Sep-07 8:29
mvePete O'Hanlon3-Sep-07 8:29 
QuestionHow to retrieve local machine time using sql query in Sqlserver 2005 Pin
pashitech3-Sep-07 7:17
pashitech3-Sep-07 7:17 
AnswerRe: How to retrieve local machine time using sql query in Sqlserver 2005 Pin
Paul Conrad3-Sep-07 7:54
professionalPaul Conrad3-Sep-07 7:54 
AnswerRe: How to retrieve local machine time using sql query in Sqlserver 2005 Pin
jschell3-Sep-07 8:00
jschell3-Sep-07 8:00 
Questionhow to manage array in sql insert trigger Pin
purushotam3-Sep-07 4:30
purushotam3-Sep-07 4:30 
AnswerRe: how to manage array in sql insert trigger Pin
Pete O'Hanlon3-Sep-07 5:07
mvePete O'Hanlon3-Sep-07 5:07 
Questionwhat is wrong with the code Pin
prasadbuddhika3-Sep-07 3:21
prasadbuddhika3-Sep-07 3:21 
scon.ConnectionString = <br />
             "integrated security= true ;" +"initial catalog =my;" + <br />
              "data source =BUDDHIKA\\SQLEXPRESS;";<br />
<br />
<br />
        scon.Open();<br />
<br />
        sc.Connection = scon;<br />
<br />
        sc.CommandText = "create login " + textBox6.Text +<br />
                 " with password ='" + textBox7.Text + "' ";<br />
<br />
       sc.CommandText += "exec sp_addsrvrolemember " <br />
               + textBox6.Text+ ",sysadmin  ";<br />
<br />
      sc.CommandText += "create user " + textBox6.Text + " from login " <br />
               + textBox6.Text + " use my ";<br />
<br />
      sc.CommandText += "execute sp_addrolemember " <br />
           + comboBox3.SelectedItem.ToString() + "," + textBox6.Text <br />
           + " use my";<br />
                <br />
      SqlDataReader sd = sc.ExecuteReader();<br />
<br />
      sd.Close();<br />
<br />
      sc.CommandText = "insert into my.dbo.sys_usr values <br />
     ('" + comboBox4.SelectedItem.ToString() + "','" + textBox1.Text <br />
       + "','" + textBox46.Text + "','" + textBox2.Text + "','"  <br />
      + comboBox2.SelectedItem.ToString() + "','" <br />
       + Box3.SelectedItem.ToString() + "')";<br />
<br />
     sd = sc.ExecuteReader();


when i run this code get an error

Incorrect syntax near the keyword 'with'.
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.

AnswerRe: what is wrong with the code Pin
Blue_Boy3-Sep-07 4:19
Blue_Boy3-Sep-07 4:19 
AnswerRe: what is wrong with the code Pin
Paddy Boyd3-Sep-07 4:26
Paddy Boyd3-Sep-07 4:26 
AnswerRe: what is wrong with the code Pin
Pete O'Hanlon3-Sep-07 5:06
mvePete O'Hanlon3-Sep-07 5:06 
AnswerRe: what is wrong with the code Pin
Colin Angus Mackay4-Sep-07 0:52
Colin Angus Mackay4-Sep-07 0:52 
QuestionXml BulkLoad Pin
Panchal Hardik3-Sep-07 0:54
Panchal Hardik3-Sep-07 0:54 
AnswerRe: Xml BulkLoad Pin
Panchal Hardik3-Sep-07 2:39
Panchal Hardik3-Sep-07 2:39 
GeneralRe: Xml BulkLoad Pin
Pete O'Hanlon3-Sep-07 2:51
mvePete O'Hanlon3-Sep-07 2:51 
GeneralRe: Xml BulkLoad Pin
Panchal Hardik3-Sep-07 2:58
Panchal Hardik3-Sep-07 2:58 
QuestionCombine result Pin
RichardBlare3-Sep-07 0:39
RichardBlare3-Sep-07 0:39 
AnswerRe: Combine result Pin
Pete O'Hanlon3-Sep-07 0:56
mvePete O'Hanlon3-Sep-07 0:56 
GeneralRe: Combine result Pin
RichardBlare3-Sep-07 23:19
RichardBlare3-Sep-07 23:19 
QuestionHelp me! Pin
chanzeb2-Sep-07 21:01
chanzeb2-Sep-07 21:01 
AnswerRe: Help me! Pin
Pete O'Hanlon2-Sep-07 21:44
mvePete O'Hanlon2-Sep-07 21:44 
GeneralRe: Help me! Pin
chanzeb3-Sep-07 0:15
chanzeb3-Sep-07 0:15 
QuestionGet databases Pin
Syed Mujtaba Hassan2-Sep-07 20:15
Syed Mujtaba Hassan2-Sep-07 20:15 
AnswerRe: Get databases Pin
John-ph2-Sep-07 20:43
John-ph2-Sep-07 20:43 
AnswerRe: Get databases Pin
shivvish2-Sep-07 21:12
shivvish2-Sep-07 21:12 

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.