Click here to Skip to main content
15,884,298 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Finding IP Address of Device Connected To PC via LAN Cable. Pin
Dave Kreskowiak17-May-09 3:27
mveDave Kreskowiak17-May-09 3:27 
Question[RESOLVED] Trying to use smo to create an insert stored proc which returns identity [modified] Pin
bobishkindaguy14-May-09 14:12
bobishkindaguy14-May-09 14:12 
AnswerRe: Trying to use smo to create an insert stored proc which returns identity Pin
Dave Kreskowiak15-May-09 4:15
mveDave Kreskowiak15-May-09 4:15 
GeneralRe: Trying to use smo to create an insert stored proc which returns identity Pin
led mike15-May-09 9:21
led mike15-May-09 9:21 
AnswerRe: Trying to use smo to create an insert stored proc which returns identity Pin
bobishkindaguy15-May-09 6:28
bobishkindaguy15-May-09 6:28 
GeneralRe: Trying to use smo to create an insert stored proc which returns identity Pin
Dave Kreskowiak15-May-09 12:05
mveDave Kreskowiak15-May-09 12:05 
QuestionRe: Trying to use smo to create an insert stored proc which returns identity [modified] Pin
bobishkindaguy17-May-09 9:39
bobishkindaguy17-May-09 9:39 
AnswerRe: Trying to use smo to create an insert stored proc which returns identity Pin
bobishkindaguy17-May-09 10:57
bobishkindaguy17-May-09 10:57 
RESOLVED !!

Thanks for your help. With a little more research, I was able to find and solve the problem. I found the error in the "InnerException". The error was: "Invalid syntax near 'PROCEDURE'". So I rechecked the sample code and noticed that the sample code did not have "CREATE PROCEDURE" in the .TextBody property.

Answer:
The lines below (marked BAD LINES) are not needed in the TextBody property, since they are actually created programmatically by SMO when the stored procedure is created with:
Dim An_SP As New StoredProcedure(mMyDatabase, Name, "dbo")
As well, the lines defining the parameters are not needed since the parameters are created programmatically by SMO with:
An_SP.Parameters.Add(New StoredProcedureParameter(An_SP, "@UserFK", DataType.Int))
BAD LINES:
An_SP.TextBody += "CREATE PROCEDURE InsertActivityRow"
An_SP.TextBody += " @UserFK int,"
An_SP.TextBody += " @MachineFK int,"
An_SP.TextBody += " @ActivityDate datetime,"
An_SP.TextBody += " @Activity int,"
An_SP.TextBody += " @TableAffected int,"
An_SP.TextBody += " @RowAffected int,"
An_SP.TextBody += " @NewPK int OUT"
An_SP.TextBody += " AS"
An_SP.TextBody += " BEGIN"
and
An_SP.TextBody += " END"

Questiontool text gdi+ Pin
ramaluciano14-May-09 4:59
ramaluciano14-May-09 4:59 
QuestionClickOnce and Sandbox? Pin
Atul Kharecha14-May-09 0:50
Atul Kharecha14-May-09 0:50 
Questionsplitting in VB.NET without delimiters Pin
poojapande13-May-09 23:06
poojapande13-May-09 23:06 
AnswerRe: splitting in VB.NET without delimiters Pin
Pete O'Hanlon13-May-09 23:24
mvePete O'Hanlon13-May-09 23:24 
GeneralRe: splitting in VB.NET without delimiters Pin
Luc Pattyn14-May-09 1:33
sitebuilderLuc Pattyn14-May-09 1:33 
AnswerRe: splitting in VB.NET without delimiters Pin
Fernando Soto14-May-09 8:28
Fernando Soto14-May-09 8:28 
QuestionDisable "Print" & "Save As" Options From Moss 2007 document Library Pin
Kronfolitto13-May-09 22:12
Kronfolitto13-May-09 22:12 
QuestionLink error with C++ code with Intel fortran code. Pin
lavate malllik13-May-09 21:47
lavate malllik13-May-09 21:47 
QuestionBootstrapper Pin
netDeveloper13-May-09 21:45
netDeveloper13-May-09 21:45 
AnswerRe: Bootstrapper Pin
netDeveloper13-May-09 22:50
netDeveloper13-May-09 22:50 
GeneralRe: Bootstrapper Pin
netDeveloper14-May-09 1:51
netDeveloper14-May-09 1:51 
QuestionWindows address book Pin
ashish purwar13-May-09 19:57
ashish purwar13-May-09 19:57 
QuestionDelete Record from Data Grid Pin
saif_saifi12-May-09 21:50
professionalsaif_saifi12-May-09 21:50 
Questionhow to paint the MainMenu Pin
coderormnger12-May-09 21:21
coderormnger12-May-09 21:21 
AnswerRe: how to paint the MainMenu Pin
Pete O'Hanlon12-May-09 22:08
mvePete O'Hanlon12-May-09 22:08 
QuestionHow to get machine certificate and user license. Pin
deadlyabbas12-May-09 21:01
deadlyabbas12-May-09 21:01 
Question.Net Remoting with COM client Pin
lee2312-May-09 19:43
lee2312-May-09 19:43 

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.