Solved

SqlDataSource

Posted on 2011-09-21
3
365 Views
Last Modified: 2012-06-27
Hi,
    I am trying to implement SqlDataSource Passing Parameter Values at Code Behind. The SqlDataSource contain 'Stored Procedure' to Update the Table, and it have two parameters . Now my Requirement is SqlDataSource does not added to any data control is it possible Passing Parameter values and Calling this SqlDataSource at Code Behind..?
0
Comment
Question by:CPSRI
3 Comments
 
LVL 5

Accepted Solution

by:
Eduardo Goicovich earned 500 total points
ID: 36574055
dsrc = New SqlDataSource()
dsrc.ConnectionString = ConnectionString
dsrc.InsertCommand = "SPNAME"
dsrc.InsertCommandType = SqlDataSourceCommandType.StoredProcedure
Dim parms As ParameterCollection = dsrc.InsertParameters
Dim newid As Integer
AddParameter(parms, "PARAM1", TypeCode.Int32, ParameterDirection.Input, 0, album.ArtistID)
AddParameter(parms, "PARAM2", TypeCode.String, ParameterDirection.Input, 0, album.Title)
parms.Add(p)
Try
   Dim rv As Integer = dsrc.Insert()
Catch ex As Exception
   Return -1
End Try
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 36575833
If your SqlDataSource is not bound to any Controls, any specific to use it?
You might want to look using SqlConnection/SqlCommand classes.
0
 

Author Closing Comment

by:CPSRI
ID: 36578310
Thank You..
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now