Showing posts with label param. Show all posts
Showing posts with label param. Show all posts

Friday, March 30, 2012

okay, I thought I had the return value from a statement figured out...

So, Jimmy G helped me out with it in showing a little bit how to do it.
SqlCommand command = new SqlCommand(, object>)SqlParameter param = new SqlParameter();param.ParameterName ="@.return";param.Direction = ParameterDirection.ReturnValue;command.Parameters.Add(param);command.ExecuteNonQuery();//get the return valueint val = int.Parse(command.Parameters[0].ToString());
 
 

Where I get lost is in the declaring of a new sqlcommand and sqlparameter. Can you please spell out where to use this and if I need to change my SQLdataSource. I currently was trying to use it in the OnClick of a button. What I had did the following

Protected Sub CreateIssue_Click(ByVal sender As Object, ByVal e As System.EventArgs)
dim returnValue as integer

'how do I get a return value from the stored procedure executed in 'insertissue.insert() here to a variable?

InsertIssue.Insert()

Response.Redirect("/addarticletoissue")


End Sub

again, thank you for your help and patience with such a beginner =)

I haven't seen your original post where jimmyg helped you out, so I am going to guess that you are trying to retrieve the autoincrement identity value of a newly added record from a SqlDataSource Try the approach detailed here:http://www.mikesdotnetting.com/Article.aspx?ArticleID=54 about 2/3rds of the way down.


|||

ahh! thank you so very much. This helps a ton!

Wednesday, March 28, 2012

Ok, now here's an easy one...

Programic render of a report to PDF, how to remove my html, and or render to a
pdf w/out my param controls?
Can I call a NewWindow? or what should I do?
I've overcome how to pass a .Net dataset to a SSRS report, smoke & mirrors, it
is a kluge but I've got it working.
It wasn't much code just'a diff'rent way o'do'in it...
Anyway, my pain.
On my web page when I call w/rs.render my report to html I get my report at top
of the page and my one paramerter textbox and cmd button, no problem.
However, when I render to PDF, .Net Dev opens and I get trash back.
When I save to disk I get trash, but if I rename and edit in Notepad, strip out
everything after the EOF, basically all the html, I get a viable PDF.Ok, I found the Example Sample FindSavePrint....
I just thought that it'd be simpler....
I streamed it....
TIA
JeffP....
"JDP@.Work" <JPGMTNoSpam@.sbcglobal.net> wrote in message
news:uZdyHO4bEHA.252@.TK2MSFTNGP10.phx.gbl...
> Programic render of a report to PDF, how to remove my html, and or render to a
> pdf w/out my param controls?
> Can I call a NewWindow? or what should I do?
> I've overcome how to pass a .Net dataset to a SSRS report, smoke & mirrors, it
> is a kluge but I've got it working.
> It wasn't much code just'a diff'rent way o'do'in it...
> Anyway, my pain.
> On my web page when I call w/rs.render my report to html I get my report at
top
> of the page and my one paramerter textbox and cmd button, no problem.
> However, when I render to PDF, .Net Dev opens and I get trash back.
> When I save to disk I get trash, but if I rename and edit in Notepad, strip
out
> everything after the EOF, basically all the html, I get a viable PDF.
>
>