Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: mystery NaN Pin
harold aptroot1-Dec-11 5:33
harold aptroot1-Dec-11 5:33 
QuestionAsp.Net nested Accordion menu Pin
Balakrishnan Dhinakaran30-Nov-11 19:31
professionalBalakrishnan Dhinakaran30-Nov-11 19:31 
AnswerRe: Asp.Net nested Accordion menu Pin
Richard MacCutchan30-Nov-11 22:34
mveRichard MacCutchan30-Nov-11 22:34 
AnswerRe: Asp.Net nested Accordion menu Pin
#realJSOP1-Dec-11 1:59
professional#realJSOP1-Dec-11 1:59 
Questionhow to make a web page? Pin
nik_utm30-Nov-11 15:54
nik_utm30-Nov-11 15:54 
AnswerRe: how to make a web page? Pin
Richard MacCutchan30-Nov-11 22:35
mveRichard MacCutchan30-Nov-11 22:35 
GeneralRe: how to make a web page? Pin
nik_utm1-Dec-11 14:47
nik_utm1-Dec-11 14:47 
QuestionC# remoting server and client problem Pin
kornkimhour30-Nov-11 15:13
kornkimhour30-Nov-11 15:13 
AnswerRe: C# remoting server and client problem Pin
Richard MacCutchan30-Nov-11 22:32
mveRichard MacCutchan30-Nov-11 22:32 
QuestionSQL Server and C# Pin
john john mackey30-Nov-11 10:42
john john mackey30-Nov-11 10:42 
AnswerRe: SQL Server and C# Pin
PIEBALDconsult30-Nov-11 10:55
mvePIEBALDconsult30-Nov-11 10:55 
GeneralRe: SQL Server and C# Pin
john john mackey30-Nov-11 12:28
john john mackey30-Nov-11 12:28 
GeneralRe: SQL Server and C# Pin
PIEBALDconsult30-Nov-11 14:56
mvePIEBALDconsult30-Nov-11 14:56 
AnswerRe: SQL Server and C# Pin
Mycroft Holmes30-Nov-11 17:01
professionalMycroft Holmes30-Nov-11 17:01 
GeneralRe: SQL Server and C# Pin
john john mackey1-Dec-11 11:01
john john mackey1-Dec-11 11:01 
AnswerRe: SQL Server and C# Pin
BobJanova1-Dec-11 1:46
BobJanova1-Dec-11 1:46 
GeneralRe: SQL Server and C# Pin
john john mackey1-Dec-11 11:23
john john mackey1-Dec-11 11:23 
AnswerRe: SQL Server and C# Pin
jschell1-Dec-11 13:50
jschell1-Dec-11 13:50 
QuestionC# desktop controls Pin
classy_dog30-Nov-11 6:19
classy_dog30-Nov-11 6:19 
AnswerRe: C# desktop controls Pin
fjdiewornncalwe30-Nov-11 8:39
professionalfjdiewornncalwe30-Nov-11 8:39 
AnswerRe: C# desktop controls Pin
BillWoodruff30-Nov-11 14:22
professionalBillWoodruff30-Nov-11 14:22 
QuestionHow do I make Post Publish Tasks work? DLL is locked? Pin
KevonHoughton30-Nov-11 5:37
KevonHoughton30-Nov-11 5:37 
Questionrun sql script in C# Pin
jojoba201130-Nov-11 0:09
jojoba201130-Nov-11 0:09 
When i wanna to run script of create/Alter View i get the following error :

My Source is :

C#
SqlConnection con = new SqlConnection(conString);
            SqlCommand cmd = new SqlCommand();
            try
            {

                string command = @"create view d_jest
as
SELECT     dbo.AccDocumentDetailsVosoolBargasht.VosoolBargashtId, dbo.AccDocumentDetailsVosoolBargasht.AccDocumentDetailsId, 
                      dbo.VosoolBargasht.GhabzDetailsId, dbo.VosoolBargasht.Type, dbo.AccDocumentDetail.AccDocumentID
FROM         dbo.AccDocumentDetailsVosoolBargasht INNER JOIN
                      dbo.VosoolBargasht ON dbo.AccDocumentDetailsVosoolBargasht.VosoolBargashtId = dbo.VosoolBargasht.ID INNER JOIN
                      dbo.AccDocumentDetail ON dbo.AccDocumentDetailsVosoolBargasht.AccDocumentDetailsId = dbo.AccDocumentDetail.ID
                      
Go

Create view d_kest
  as
  SELECT     dbo.AccDocumentDetail.AccDocumentID, dbo.AccdocumentDetailsTafsiliShenavar.TafsiliShenavarId, 
                      dbo.AccdocumentDetailsTafsiliShenavar.AccDocumentDetailId, dbo.AccdocumentDetailsTafsiliShenavar.ID, dbo.TafsiliShenavar.Name, 
                      dbo.TafsiliShenavar.Code
FROM         dbo.AccdocumentDetailsTafsiliShenavar INNER JOIN
                      dbo.TafsiliShenavar ON dbo.AccdocumentDetailsTafsiliShenavar.TafsiliShenavarId = dbo.TafsiliShenavar.ID INNER JOIN
                      dbo.AccDocumentDetail ON dbo.AccdocumentDetailsTafsiliShenavar.AccDocumentDetailId = dbo.AccDocumentDetail.ID                    
Go                      ";
                cmd.CommandText = command;
                cmd.Connection = con;
                con.Open();
                int result = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if (con.State == ConnectionState.Open)
                con.Close();


I get this error :

Incorrect syntax near 'GO'<br />
'CREATE VIEW' must be the first statement in a query batch.<br />
Incorrect syntax near 'GO'


but if i run this script directly in sql i wont get an error and every thing is right there.
AnswerRe: run sql script in C# Pin
Pete O'Hanlon30-Nov-11 0:17
mvePete O'Hanlon30-Nov-11 0:17 
QuestionRe: run sql script in C# <code>new</code> Pin
jojoba201130-Nov-11 0:22
jojoba201130-Nov-11 0:22 

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.