Solved

SqlDataSource

Posted on 2011-09-21
3
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 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