argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable

I have an SqlDataSource control on my aspx page, this is connected to database by a built in procedure that returns a string dependent upon and ID passed in.

 I have the followinbg codewhich is not complet, I woiuld appriciate any help to produce the correct code for the code file

 Function GetCategoryName(ByVal ID As Integer) As String
          sdsCategoriesByID.SelectParameters("ID").Direction = Data.ParameterDirection.Input
          sdsCategoriesByID.SelectParameters.Item(
"ID").DefaultValue = 3
          sdsCategoriesByID.Select() <<<< THIS LINE COMES UP WITH ERROR 1
End Function

ERROR AS FOLLOWS

argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable

 

Help I have not got much more hair to loose

Thanks Steve

0
MrShrek
3/26/2007 1:59:36 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

5 Replies
1244 Views

Similar Articles

[PageSpeed] 55

HI Steve,

instead of calling  sdsCategoriesByID.Select()

I would suggest you to call the DataBind() method of the control that is bound against that SqlDataSource : for example gridview1.DataBind();

or if you need really to call the select method then just create a new instance of:

DataSourceSelectArguments arguments = new DataSourceSelectArguments();

 sdsCategoriesByID.Select(arguments);

reference: 

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.select.aspx 

 Cheers,

Yani 

0
Yani
3/26/2007 10:37:11 AM

Thanks for above answer, had thought of that way, but not sure hpow to add in the argument, in this case I need to pass in the ID value???!!!

 I have found this code but even this has the same problem

Dim instance As SqlDataSource
Dim arguments As DataSourceSelectArguments
Dim returnValue As IEnumerable
instance = sdsCategoriesByID
arguments = <<< NOT SURE HERE  >>>
returnValue = instance.Select(arguments)

 

 in the case above i would pass the value 1 to the parameter @ID, this hopefully would return the category name in the text format "COOKING" for example

 

Steve

0
MrShrek
3/26/2007 3:30:45 PM

The SelectArgumenets is something different to SelectParameters:

so you still specify the params with:

sdsCategoriesByID.SelectParameters("ID").Direction = Data.ParameterDirection.Input
sdsCategoriesByID.SelectParameters.Item(
"ID").DefaultValue = 3

and just pass a new instance of DataSourceSelectArguments to the Select method.

Cheers,

Yani 

0
Yani
3/26/2007 3:45:38 PM

this is were i am having the problem, I can not get the syntax right to set the DataSourceSelectArguments, in this case the stored proc requires 1 value being @ID.

 

Unable to figure it out looke thrpough google, very simple thing but I can not find how!!!! Crying

 

Steve

0
MrShrek
3/27/2007 8:20:44 AM

Hi, Steve,

i hope you will be able to 'translate' this c# code into vb.net and it will help you:

 

 

SqlDataSource sdsCategoriesByID = new SqlDataSource();

    private void InitSqlDataSource(int id)
    {
        sdsCategoriesByID.SelectParameters.Add("ID", id.ToString());
        DataSourceSelectArguments args = new DataSourceSelectArguments();

        IEnumerable result = sdsCategoriesByID.Select(args);
        //
        // do what ever you need with the result
        //
    }

  

Cheers,

Yani 

0
Yani
3/27/2007 8:37:54 AM
Reply:

Similar Artilces:

argument not specified for parameter 'arguments'
Hi there, I'm failing to understand something pertaining to a vb page using SqlDataSource...  At numerous points in my project I use forms to programatically add data to INSERT and UPDATE statements such as the following... Dim InsertSqlString as StringInsertSqlString = "INSERT INTO tbl yada yada..."SqlDataSource.InsertCommandType = InsertCommandType.TextSqlDataSource.InsertCommand = InsertSqlStringSqlDataSource.Insert() However if I try to do the same using a SELECT statement it gives me the error argument not specified for parameter 'arguments' Any paramete...

error BC30455: Argument not specified for parameter 'e' of 'Public Function [name_of_function]
Hello, Still a bit new to ASP.NET/VB.NET and I am having a problem with one of my Sub procedures getting a boolean value from a function. Here is the calling sub: sub dgData_Update(Sender as Object, e as DataGridCommandEventArgs) if UpdateDataStore then FillDataGrid(-1) end if end sub Here is the function it is calling: function UpdateDataStore(e as DataGridCommandEventArgs) as boolean dim i, j as integer dim params(7) as string dim strText as string dim blnGo as boolean = true ...

Argument not specified for parameter '<parameter>' of 'Public Sub New
Hi, anybody have an idea on what i am doing wrong here:--------------------ERROR---------------------------- Compiler Error Message: BC30455: Argument not specified for parameter 'dteRDate' of 'Public Sub New(strOName As String, strOAdd As String, intOPhone As Integer, strVer As String, dteRDate As Date, dteWDate As Date, strONote As String, strOrName As String, strOrJob As String, strOrEmail As String, intOrPhone As Integer, intOrMobile As Integer, strOrAdd As String)'.Source Error: Line 228: Line 229: Public Sub New()Line 230: M...

The type arguments for method 'System.Linq.Enumerable.Where<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,int,bool>)' cannot be inferred from the usage. Try specifying
Hi I get the error message above on the following piece of code: SPView _view = Web.Lists["Client Contact"].Views["All Items"];SPListItemCollection listItems = Web.Lists["Companies"].GetItems(_view);string CompanyChoice = default(string);string comp = "Company"; IEnumerable<string> FilteredLists = listItems.OfType<string>().Where(listItems[comp].ToString().Equals(CompanyChoice)); I get the error on the last line, I'm not enitrely sure why? Can anyone see where I am going wrong?  many thanks...

Error 17 Argument '2': cannot convert from 'System.Web.UI.WebControls.FontSize' to 'float'
Error 17 Argument '2': cannot convert from 'System.Web.UI.WebControls.FontSize' to 'float' Error 16 The best overloaded method match for 'System.Drawing.Font.Font(string, float, System.Drawing.FontStyle)' has some invalid arguments Code:chart.DrawString(Convert.ToString(barValue[i]), new Font("arial", FontSize.Small, FontStyle.Regular), TEXT_COLOR, (columnSpacing + CHART_LEFT_MARGIN), (BMP_HEIGHT - (CHART_BOTTOM_MARGIN - (currentBarHeight - BAR_LABEL_SPACE)))); Any solution? I would be grateful for any help. new Font("...

Error 102 Argument '12': cannot convert from 'ref System.Guid' to 'System.Guid?'
Hi  I have a stored proc as follows: USE [SubSrvs]GO/****** Object:  StoredProcedure [dbo].[subsrvs_Services_CreateService]    Script Date: 07/15/2007 11:39:38 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[subsrvs_Services_CreateService] @Level1    nvarchar(max),    @Level2    nvarchar(max),    @Level3    nvarchar(max),    @Level4    nvarchar(max),    @Level5    nvarchar(max...

Too man arguments to 'Public Function Save() As System.Drawing.Drawing2D.GraphicsState'
This is my first time using the System.Drawing Namespace and I'm having an issue creating the image.  I keep getting the message that I have too many arguments when i try to save the image, although all the tutorials I've seen show a path argument and a file format argument.  When I remove one argument I still get the message.  When I remove both arguments I get no error which makes me think its saving the image somewhere without me specifying a location!  Here is my VB.NET codebehind.  1 Imports System.Math 2 Imports System.Drawing 3 Imports Syst...

Argument not specified for parameter 'e'
can someone tell me wats the error in line 79? Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30455: Argument not specified for parameter 'e' of 'Public Function updatedatastore(e As System.Web.UI.WebControls.DataGridCommandEventArgs) As Boolean'. Source Error: Line 77: Line 78: sub dgdata_update (sender as object, e as datagridcommandeventargs) (error) Line 79: if updatedatas...

Argument not specified for parameter 'E'
I am trying to create a database connection as a SUB. It works great until I need to Edit the record. When I rebind the data it gives me the error "Argument not specified for parameter 'E' ". Can this work? My guess is one of my parameters has a ' for the value, which is throwing off your parameters? Are you custom creating the SQL when you do the edit? Could you post code? BrianBrian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4). Here ...

Argument not specified for parameter 'LogoPrice'
Hi,I'm trying to pass a variable between two sub; I've never done this before, so I'm getting an error, and I could use some help.  The error is: Server Error in '/Sites/HopkinsTransport' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30455: Argument not specified for parameter 'LogoPrice' of 'Public S...

'System.Windows.Forms.DataGridView' does not contain a definition for 'databind' and no extension method 'databind' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be foun
 Error    1    'System.Windows.Forms.DataGridView' does not contain a definition for 'databind' and no extension method 'databind' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found (are you missing a using directive or an assembly reference?) how to solve this Are you using a web applictaion or windows application. If web aplictaion then you should not use 'System.Windows.Forms.DataGridView'  Try using system.web.ui.control.datagridVikram www.vikramlakhotia.comPlease ma...

Argument not specified for parameter 'e' #2
I'm fairly new to VB.net and I'm still trying to grasp the concept of event handlers and passing arguments to subroutines.   I think I'm getting this error because my BindDataGrid() sub expects an argument or two and I'm supplying it in SortCommand_OnClick ?  I'm lost... Thanks.Sub BindDataGrid(ByVal Source As Object, ByVal e As EventArgs)                  'Open a SQLConnection and bind to my datagridEnd SubSub SortCommand_OnClick(Source As Object, e As DataGridSortCommandEventArgs)&...

BC30455: Argument not specified for parameter 's_TITLE'
 Hi, I am getting the error above when trying to insert a person into my database table. It says that I am not passing in the title paramater, but it looks to me as if I am (I've even hardcoded it to be sure, see bold values) Error: BC30455: Argument not specified for parameter 's_TITLE' of 'Public Shared Sub AddPersonDetails(s_UNIQUEID As String, s_NAME As String, s_VIEWT As String, s_STATUS As String, s_REFNO As String, s_TEMPCONS As String, s_POSTCODE As String, s_FAX As String, s_SALUTATION As String, s_TITLE As String, s_CREATED As String, s_UPDATE...

Procedure or function '' has too many arguments specified.
Im getting this error when looping through a gridview. Im trying to save each row into the database. The weird thing is that it saves the first row, but errors out on the second.If I only add one item to the gridview, it works. The second row is screwing it up somehow.  Any ideas?  ------------------------------------------------------------------------------------------------------------------------------------------------------------------Some of my code to get an idea of how im doing it:(This is for a shopping cart. It displays the products in the shopping cart. If the order i...

Web resources about - argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable - asp.net.sql-datasource

Resources last updated: 11/28/2015 4:10:25 AM