C# - Pass String Parameter To SqlDataSource?

Sep 16, 2010

i have placed a SqlDataSource component on my aspx page but while configuring the SqlDataSource in the "Test Query" Step I am passing the following parameters :But when i click ok it returns following error:This error occurs when i pass the string :

INFO, WARN, ERROR,

I have tried a lot of combinations but nothing works. It works only if i pass one of the three words in single quotes like this :'ERROR'Infact the INFO WARN and ERROR are the various levels available in the table. Each record can have only one level and in the sql query i am using IN("-----") to match the criteria, hope you understand.

View 2 Replies


Similar Messages:

C# - How To Pass Parameter To SQlDataSource From Gridview

Apr 7, 2010

Gridview has many columns and a Delete button as well. Delete button is a control as TemplateField

[code]....

Now associated SQLDataSource's Delete command's stored procedure is expecting two parameters. One is going from DataKeyNames (RowID), other one i wanna pass is the Text of btnDelete (True or False).

View 1 Replies

Web Forms :: Pass Cookie Value As Parameter To SqlDataSource

Jan 24, 2016

asp:querystringparameter assign value how to ...

View 1 Replies

C# - Adding Parameter To Sqldatasource - Pass Them To Execute Stored Procedure

Mar 2, 2010

I am using a gridview where i am calling a stored procedure which has 4 input parameters. Out of these 4 parameters, values are to be given such that DomainId = This has to be the row which is to be deleted. This is a primary key Domain = This field has to be passed to SP as NULL. Description= This field has to be passed as NULL. OperationType= This field has to be passed by programmer as some static value say 4 How to i need to specify these here... More details of the Question are here.

<DeleteParameters>
<asp:ControlParameter ControlID="GridView1" Name="DomainId"
PropertyName="SelectedValue" Size="4" Type="Int32" />
<asp:Parameter DefaultValue="" Name="Domain" Size="16" Type="String" />
<asp:Parameter DefaultValue="" Name="Description" Type="String" />
<asp:Parameter DefaultValue="4" Name="OperationType" Type="Byte" />
</DeleteParameters>

On running my code using this. I gets an error

Procedure or Function 'spOnlineTest_Domain' expects parameter '@Domain', which was not supplied

View 2 Replies

Forms Data Controls :: ASPxRadioButtonList Inside ASPxDataView Within Item Template - Pass Parameter To Second SqlDataSource (id) To Fill RadioButtonList Property

Aug 29, 2010

I have ASPxDataView and ASPxRadioButtonList within item template. i also have two SQLDataSource's (first fill ASPxDataView, second ASPxRadioButtonList). They are using other database tables connected with the foreign key. Is there any way to pass parameter to my second sqlDataSource (id) to fill RadioButtonList property ? i mean select * from TABLE2 where id = @id ; (@id is a value from TABLE1 which is a value of column returned by first sqlDataSource)

View 3 Replies

Web Forms :: Calling Page - Pass Parameter In Url Query String?

Apr 14, 2010

We are using a asp.net page to submit data to server. what we do is we will pass as parameter in url Query string) and in page load we take that values and submitting to database I have these following doubt

1, What is the default event happening while we call a ASP.NET page is it a POST or GET? We tried to call this url from a mobile application, it is not happening , we are not getting any error also in the mobile application.

2, IF we are calling the url to submit data from mobile applications which one we have to use (GET or POST)

3, IF we are calling this url from an application running in PC to submit which one we have to use ?

View 3 Replies

Web Forms :: How To Pass A Long Parameter String (more Than 256 Chars) Via Querystring

Aug 30, 2010

In my project one of scenario demands passing querystring values more than 256 chars @ a time ...I tried it but after 256 chars its trunacting all other chars. workaround or various ways for passing more than 256 chars through querystring.

View 6 Replies

Web Forms :: Trying To Pass A String Variable As A Parameter To The Document.getElementByID Function

Jan 17, 2011

I have a label "lbl1" that I am trying to locate in a content page from the Master page. I want to do it dynamically so I am trying to pass the name of the control (which in this case is lbl1) through as a parameter. I don't get an error, it just doesn't work. If I do an alert to see what the string "temp" looks like, it is correct, but iit seems as if Javascript ignores it. I believe it has something to do with the '<%= not being interpreted correctly by the browser&nbsp; I'm sure it is a simple solution, but I can't figure it out!

</textarea></p>
<input type='hidden' name='ID[4]' value='104170' />
<input type='hidden' name='URL[4]' value='http://forums.asp.net/t/1540102.aspx' />
<input type='hidden' name='CAT[4]' value='DataSource Controls' />
<input type='hidden' name='BOARD[4]' value='microsoft' />
<input type='hidden' name='P_DATE[4]' value='Mar 25, 2010 04:38 AM' />
<input type='hidden' name='RANDOM[4]' value='MKH9Tb4zY' />
<input type='hidden' name='REPLIES[4]' value='3' />
<input type='hidden' name='USER[4]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[4]' value='DataSource Controls :: passing control parameter to sql datasource in code behind' /><select name='INDEXED[4]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Mar 25, 2010 04:38 AM - Replies: 3 CAT: DataSource Controls<a target=_blank href="http://forums.asp.net/t/1540102.aspx">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[4]' onfocus='setSelRange(this, 0, 0)'/>

I need to pass the control parameter to Sql Datasource in code behind,

<asp:ControlParameter ControlID="DDL_RType" Name="rtype" PropertyName="SelectedValue"</textarea></p>
<input type='hidden' name='ID[5]' value='119283' />
<input type='hidden' name='URL[5]' value='http://forums.asp.net/t/1574009.aspx' />
<input type='hidden' name='CAT[5]' value='Forms Data Controls' />
<input type='hidden' name='BOARD[5]' value='microsoft' />
<input type='hidden' name='P_DATE[5]' value='Jun 30, 2010 11:12 AM' />
<input type='hidden' name='RANDOM[5]' value='vaWaIeNdo' />
<input type='hidden' name='REPLIES[5]' value='4' />
<input type='hidden' name='USER[5]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[5]' value='Forms Data Controls :: Pass parameter to object datasource in user control.' /><select name='INDEXED[5]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Jun 30, 2010 11:12 AM - Replies: 4 CAT: Forms Data Controls<a target=_blank href="http://forums.asp.net/t/1574009.aspx">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[5]' onfocus='setSelRange(this, 0, 0)'/>

I have a gridview inside a user control bind to an object datasource. Now I want to bind the object datasource with a parameter from parent page. For this purpose I defined a public property in user control but how do I pass it with object datasource? I am calling from parent page like myusercontrol.parameter=querystring["id"]; How to bind object datasource with my parameter?

</textarea></p>
<input type='hidden' name='ID[6]' value='184482' />
<input type='hidden' name='URL[6]' value='http://stackoverflow.com/questions/3627231/datasource-with-parameter-in-aspx-page-to-move-in-user-control' />
<input type='hidden' name='CAT[6]' value='ASP.NET' />
<input type='hidden' name='BOARD[6]' value='stackoverflow' />
<input type='hidden' name='P_DATE[6]' value='Sep 2 10 at 12:49' />
<input type='hidden' name='RANDOM[6]' value='bYX0jeAEp' />
<input type='hidden' name='REPLIES[6]' value='2' />
<input type='hidden' name='USER[6]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[6]' value='asp.net - Datasource with parameter in ASPX page to move in user control' /><select name='INDEXED[6]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Sep 2 10 at 12:49 - Replies: 2 CAT: ASP.NET<a target=_blank href="http://stackoverflow.com/questions/3627231/datasource-with-parameter-in-aspx-page-to-move-in-user-control">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[6]' onfocus='setSelRange(this, 0, 0)'/>

I have a page with some datasources in it. I am doing reenginering of the page itself and would like to split some parts of the page in several user controls. In my code I have an ObjectDataSource object with the following params

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="DataSetTableAdapters.PhotosTableAdapter"
SelectMethod="GetPhotosForAlbum">
<SelectParameters>
<asp:ControlParameter Name="albumID" ControlID="txtAlbumID" Type="Int32"/>
</SelectParameters>
</asp:ObjectDataSource>

This piece of code automatically bind the hidden field "txtAlbumId" to the datasource. In my revision this datasource should be moved to a user control. What is the best way to handle a scenario like this?

</textarea></p>
<input type='hidden' name='ID[7]' value='34389' />
<input type='hidden' name='URL[7]' value='http://forums.asp.net/t/1627446.aspx' />
<input type='hidden' name='CAT[7]' value='Web Forms' />
<input type='hidden' name='BOARD[7]' value='microsoft' />
<input type='hidden' name='P_DATE[7]' value='Nov 26, 2010 08:25 PM' />
<input type='hidden' name='RANDOM[7]' value='UEVLcNi9r' />
<input type='hidden' name='REPLIES[7]' value='4' />
<input type='hidden' name='USER[7]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[7]' value='Web Forms :: How to parse a string variable for diplay in control' /><select name='INDEXED[7]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Nov 26, 2010 08:25 PM - Replies: 4 CAT: Web Forms<a target=_blank href="http://forums.asp.net/t/1627446.aspx">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[7]' onfocus='setSelRange(this, 0, 0)'/>&nbsp;How can i&nbsp;&nbsp;display the string variable data "234,345,567,678" into a listbox?

i wish to parse the delimited string as seperate items.

the string can vary in&nbsp;length.&nbsp;</textarea></p>
<input type='hidden' name='ID[8]' value='175584' />
<input type='hidden' name='URL[8]' value='http://stackoverflow.com/questions/2866868/datasource-select-parameter-from-get-value' />
<input type='hidden' name='CAT[8]' value='ASP.NET' />
<input type='hidden' name='BOARD[8]' value='stackoverflow' />
<input type='hidden' name='P_DATE[8]' value='May 19 10 at 15:21' />
<input type='hidden' name='RANDOM[8]' value='XYAWdt1ps' />
<input type='hidden' name='REPLIES[8]' value='1' />
<input type='hidden' name='USER[8]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[8]' value='c# - DataSource Select Parameter from GET value' /><select name='INDEXED[8]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>May 19 10 at 15:21 - Replies: 1 CAT: ASP.NET<a target=_blank href="http://stackoverflow.com/questions/2866868/datasource-select-parameter-from-get-value">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[8]' onfocus='setSelRange(this, 0, 0)'/>How can I use the value of a GET form value as a SelectParameter?

Note: Both C# and VB.NET answers are fine.

</textarea></p>
<input type='hidden' name='ID[9]' value='46929' />
<input type='hidden' name='URL[9]' value='http://forums.asp.net/t/1542116.aspx' />
<input type='hidden' name='CAT[9]' value='Web Forms' />
<input type='hidden' name='BOARD[9]' value='microsoft' />
<input type='hidden' name='P_DATE[9]' value='Mar 31, 2010 01:51 AM' />
<input type='hidden' name='RANDOM[9]' value='iX9IkD8rq' />
<input type='hidden' name='REPLIES[9]' value='1' />
<input type='hidden' name='USER[9]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[9]' value='Web Forms :: How to pass parameter in DropdownList Datasource' /><select name='INDEXED[9]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Mar 31, 2010 01:51 AM - Replies: 1 CAT: Web Forms<a target=_blank href="http://forums.asp.net/t/1542116.aspx">View</a></p>
<p> <textarea rows=10 cols=100 name='POST[9]' onfocus='setSelRange(this, 0, 0)'/>

I just like to know how to pass a parameter to the datasource of my dllItemCodeFooter&nbsp;and dllItemCodeEdit Drowndownlist which calls my getItemCodeList(decimal categoryID) method in the code behind. The value of the parameter will be seletectedValue of the first dropdownlist ddlCategoryFooter&nbsp;or&nbsp;ddlCategoryEdit).I know it could be done in code behind, but i prefer to bind my datasource in asp page. I want to achieve something like this DataSource='<%# getItemCodeList(ddlCategoryEdit.Seletected)%>'

[Code]....

View 7 Replies

ADO.NET :: Add A Parameter To Sqldatasource During RowDataBound?

Aug 12, 2010

So I have a gridview within a gridview (I have a one to many table) my first gridview is working well, but my second gridview has a sqldatasource that has a select parameter(the default value was just for testing)

<asp:SqlDataSource ID="dsCountryByTripID" runat="server" ConnectionString="<%&#36; ConnectionStrings:bahDatabase %>" SelectCommand="spSelectCitiesByTripID" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Type="Int32" Name="tripID" DefaultValue="56" /> </SelectParameters> </asp:SqlDataSource>

during my Gridview1 row databound I am trying to grab the columns that match the tripID. But dsCountryByTripID which is my datasource, is only going inputted with the last tripID.

protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e) { GridView gv2 = (GridView)e.Row.FindControl("GridView2"); if (e.Row.RowType == DataControlRowType.DataRow) { dsCountryByTripID.SelectParameters.Clear(); DataRowView drv = (DataRowView)e.Row.DataItem; string tripID = (drv["pkiTripId"]).ToString(); dsCountryByTripID.SelectParameters.Add("tripID", DbType.Int32, tripID); //gv2.DataBind(); //e.Row.DataBind(); } }

View 1 Replies

C# - Add A Parameter To Sqldatasource During RowDataBound

Aug 11, 2010

So I have a gridview within a gridview (I have a one to many table) my first gridview is working well, but my second gridview has a sqldatasource that has a select parameter(the default value was just for testing)

<asp:SqlDataSource ID="dsCountryByTripID" runat="server"
ConnectionString="<%$ ConnectionStrings:bahDatabase %>"
SelectCommand="spSelectCitiesByTripID" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Type="Int32" Name="tripID" DefaultValue="56" />
</SelectParameters>
</asp:SqlDataSource>
during my Gridview1 row databound I am trying to grab the columns that match the tripID. But dsCountryByTripID which is my datasource, is only going inputted with the last tripID.
protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
GridView gv2 = (GridView)e.Row.FindControl("GridView2");
if (e.Row.RowType == DataControlRowType.DataRow)
{
dsCountryByTripID.SelectParameters.Clear();
DataRowView drv = (DataRowView)e.Row.DataItem;
string tripID = (drv["pkiTripId"]).ToString();
dsCountryByTripID.SelectParameters.Add("tripID", DbType.Int32, tripID);
//gv2.DataBind();
//e.Row.DataBind();
}
}

View 2 Replies

Use A Custom Parameter With SqlDataSource?

Jan 17, 2011

I want to add a GridView control to one of my views that is backed by a SqlDataSource. The SelectCommand query is parametrized on the aspnet_Users.UserId GUID for the currently-logged-in user, so I need a way to pass the user ID as a parameter.

I read How to utilize ASP.NET current user name in SqlParameter without code-behind and decided to create a custom Parameter named UserIdParameter:

namespace MyApp.Web
{
public class UserIdParameter : Parameter
{
public UserIdParameter(string name)
: base(name)
{
}
protected UserIdParameter(UserIdParameter parameter)
: base(parameter)
{
}

protected override Parameter Clone()
{
return new UserIdParameter(this);
}
protected override object Evaluate(HttpContext context, Control control)
{
return Membership.GetUser().ProviderUserKey;
}
}
}

In the ASPX view I then added:

<%@ Register TagPrefix="my" Namespace="MyApp.Web" %>

in a line after the <%@ Page ... %> line as well as:

<SelectParameters>
<my:UserIdParameter Name="UserId" />
</SelectParameters>

within the asp:SqlDataSource element.

Unfortunately I get a Parser Error ("An error occurred during the parsing of a resource required to service this request. review the following specific parse error details and modify your source file appropriately.") with the following highlighted in red:

<my:UserIdParameter Name="UserId" />

Visual Web Developer 2010 Express is also informing me that "Element 'UserIdParameter' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing."

Do I need to modify Web.config in some way? If not, what do I need to do to be able to use my custom UserIdParameter parameter?

View 2 Replies

How To Specify Parameter Value For Stored Procedure In SqlDataSource

Mar 16, 2011

Being new to using the declarative syntax of SqlDataSource I am trying to figure out a way to set the value of a parameter to a stored procedure. I have a Client_ID that is passed via the Request Object and I need to set the Client_ID before the stored procedure of the SqlDataSource is executed.

Does the stored procedure parameter have to be predefined in the ASPX markup or can it be added dynamically in the code-behind? Would anyone have an example that demonstrates the SqlDataSource markup with a stored procedure and parameter as well as setting that parameter value in code-behind?

View 1 Replies

C# - Updating SqlDataSource Parameter Via LinkButton?

Apr 10, 2010

I'll try to explain what I'm doing the best I can, but I'm pretty new to asp.net so be patient with me. I have a SqlDataSource which returns a simple select statement based on the WHERE clause using @COURSE_ID

What I want to-do is every time any one of 2 (this will change as it's going to be generated) asp:LinkButtons are pressed, they will change the @COURSEID value which i'd like to associate with the specific button.

Buttons:

<asp:LinkButton ID="LinkButton2" runat="server" onclick="MenuUpdate_Click">Course1</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="MenuUpdate_Click">Course2</asp:LinkButton>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:connString %>" SelectCommand="SELECT Chapter.chapterName, Chapter.chapterID
FROM Chapter
WHERE Chapter.courseID = @COURSE_ID
">
C#
protected void MenuUpdate_Click(object sender, EventArgs e)
{
Parameter p = SqlDataSource1.SelectParameters["COURSE_ID"];
SqlDataSource1.SelectParameters.Remove(p);
SqlDataSource1.SelectParameters.Add("COURSE_ID", THIS NEEDS TO BE VALUE ASSOCIATED TO BUTTON);
ListView1.DataBind();
UpdatePanel1.Update();
}

If anyone has any suggestions that'd be great, I've been trying lots of different things all night with no success :(

View 1 Replies

C# - Use User.Identity.Name As A Parameter For SqlDataSource?

Oct 5, 2010

For SqlDataSource I can configure the external source for the incoming paramater. For example it might be a QueryString, Session, Profile and so on. However I do not have an option to use User as a source.

I know that I could provide value for the parameter in Inserting,Selecting,Updating,Deleting events. But I do not think that this is an ellegant solution because I have some parameteres already definied in aspx file. I do not want to have parameters defined in two separate places. It makes mess.

So can I somehow define this parameter in .aspx file?

<SelectParameters>
<asp:QueryStringParameter DefaultValue="-1" Name="ID"
QueryStringField="ID" />
//User.Identity.Name goes here as a value for another parameter
</SelectParameters>

View 1 Replies

Select Parameter Not Working On SqlDataSource.

Jul 1, 2010

I am using the stored procedure below for the select command of a SqlDataSource, and I'm trying to pass a query string parameter, but I get this error:

Procedure or function 'ActivationCampaignGetById' expects parameter '@campaignId', which was not supplied.

The parameter is present in the query string:

http://localhost:62681/Activations/ActivationCampaignDetails.aspx?id=98

Here is my DataSource code:

<asp:SqlDataSource ID="campaignDataSource" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ProVantageMediaManagement %>"
SelectCommand="ActivationCampaignGetById" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="98" Name="campaignId"
QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

And my stored procedure declaration:

ALTER procedure [dbo].[ActivationCampaignGetById]
@campaignId int
as
select

View 8 Replies

Select Parameter Not Working On SqlDataSource?

Apr 18, 2010

I am using the stored procedure below for the select command of a SqlDataSource, and I'm trying to pass a query string parameter, but I get this error:

Procedure or function 'ActivationCampaignGetById' expects parameter '@campaignId', which was not supplied.

The parameter is present in the query string:

http://localhost:62681/Activations/ActivationCampaignDetails.aspx?id=98

Here is my DataSource code:

<asp:SqlDataSource ID="campaignDataSource" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ProVantageMediaManagement %>"
SelectCommand="ActivationCampaignGetById" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="98" Name="campaignId"
QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

And my stored procedure declaration:

ALTER procedure [dbo].[ActivationCampaignGetById]
@campaignId int
as
select

View 1 Replies

SQL Server :: Add Parameter To SqlDatasource With Update In GridView?

Jul 25, 2010

I have GridView1 and SqlDataSource1. I use EnableEditing to GridView1. This is Code of GridView

<
asp:GridView
ID="GridView1"
Width="100%"
runat="server"
AutoGenerateColumns="False"
BackColor="White"
BorderColor="#3366CC"
BorderStyle="None"
BorderWidth="1px"
CellPadding="4"
DataKeyNames="DoctorID"
DataSourceID="SqlDataSource1">
<RowStyle
BackColor="White"
ForeColor="#003399"
/>
<Columns>
<asp:BoundField
DataField="DoctorID"
HeaderText="DoctorID"
InsertVisible="False"
ReadOnly="True"
SortExpression="DoctorID"
/>
<asp:BoundField
DataField="DoctorName"
HeaderText="DoctorName"
SortExpression="DoctorName"
/>
<asp:BoundField
DataField="City"
HeaderText="City"
SortExpression="City"
/>
<asp:BoundField
DataField="Str"
HeaderText="Str"
SortExpression="Str"
/>
<asp:BoundField
DataField="StrRegion"
HeaderText="StrRegion"
SortExpression="StrRegion"
/>
<asp:BoundField
DataField="StringLevels"
HeaderText="StringLevels"
SortExpression="StringLevels"
/>
<asp:BoundField
DataField="Streat"
HeaderText="Streat"
SortExpression="Streat"
/>
<asp:BoundField
DataField="Email"
HeaderText="Email"
SortExpression="Email"
/>
<asp:BoundField
DataField="Mobile"
HeaderText="Mobile"
SortExpression="Mobile"
/>
<asp:BoundField
DataField="HomePhone"
HeaderText="HomePhone"
SortExpression="HomePhone"
/>
<asp:BoundField
DataField="ClinicPhone"
HeaderText="ClinicPhone"
SortExpression="ClinicPhone"
/>
<asp:BoundField
DataField="Fax"
HeaderText="Fax"
SortExpression="Fax"
/>
<asp:BoundField
DataField="address_details"
HeaderText="address_details"
SortExpression="address_details"
/>
<asp:BoundField
DataField="Expr1"
HeaderText="Expr1"
SortExpression="Expr1"
/>
<asp:BoundField
DataField="VisitPlaceStr"
HeaderText="VisitPlaceStr"
SortExpression="VisitPlaceStr"
/>
<asp:CommandField
ShowEditButton="True"
/>
</Columns>
<FooterStyle
BackColor="#99CCCC"
ForeColor="#003399"
/>............

View 1 Replies

Use JQuery Datepicker As A Control Parameter For SqlDataSource?

Mar 24, 2010

I have the need to display a date in this format: dd/mm/yyyy. This is actually being stored in an ASP.NET textbox and being used as a control parameter for a select on the GridView. When the query is run, though, the date format should change to 'd M y' (for Oracle). It is not working. Can someone tell me what I'm doing wrong? Right now I am pushing the "new" format to a invisible label and using the label as my control param:

$(document).ready(function() {
//datepicker for query, shown traditionally but holding an Oracle-needed format
$('[id$=txtBeginDate]').datepicker({ minDate: -7 , altFormat: 'd M y' });
//get alt format
var altFormat = $('[id$=txtBeginDate]').datepicker("option", "altFormat");
//set date to be altformat
$('[id$=lblActualDate]').datepicker("option", "altFormat", 'd M y');
});

View 2 Replies

DataSource Controls :: SqlDataSource - Parameter For IN() Clause

Apr 30, 2010

I have an SqlDataSource query that should use an input parameter for multiple integer values, like:

select * from table1 where TableID IN (1,2,3,4,5)

->

select * from table1 where TableID IN (@IDValues)

How do I do that ? Default parameter settings won't work, returning "invalid integer value" . I suppose that parameter should be passed as some kind of array that SQL recognizes as multiple integer values , but what's the correct way of setting this ?

View 4 Replies

DataSource Controls :: SqlDataSource Parameter Default Value?

Nov 5, 2010

I am using SqlDataSource control that retrieves information based on a city value from another control (textbox) on the page entered by the user.

[Code]....

The query works fine when the user enters a name of a city. However, if I leave the textbox blank and enter nothing, no records are returned by the query.I need all records to be returned when user leave the textbox blank and there is no value of the city.How to do that?is there a default value can do that?

View 4 Replies

Getting The Parameter Values Being Passed To SQL Database Via SQLDataSource Control

Sep 1, 2010

I have a SQLDataSource control that is calling a database stored procedure, and passing quite a large number of paramaters, and the stored proc returns records that populates a gridview control. When I walk through the code behind to determine the values being passed, is there any way that I can see exactly how the parameters are being formated and passed to the stored proc?

View 2 Replies

Forms Data Controls :: Using AND / OR Parameter From A DropDownList In A SqlDataSource

Jan 29, 2010

I am facing a small issue in using a DropDownList that has only two values (AND and OR) which i want to use to configure a SQL Query in a SqlDataSource. How can i use this thing by passing the value in a SqlDataSource Select Query in such a way to Bind the Result to a GridView. I want something like this -

SELECT [somefields] FROM instinvoice WHERE Namen = @Namen @Option InvoiceNo = @invoiceno where @Namen is from a DropDownList and InvoiceNo is from a TextBox

I m having a problem in specifying this @Option parameter from a DropDownList which contains only two list items - AND and OR. On the Basis of the Selected Value from this DropDownList i want to execute query like

SELECT [somefields] FROM instinvoice WHERE Namen = @Namen AND InvoiceNo = @invoiceno

or

SELECT [somefields] FROM instinvoice WHERE Namen = @Namen OR InvoiceNo = @invoiceno

Using the Query with @Option gives me a Parsing Error. Why is that so. How can I implement this scenario.

View 3 Replies

DataSource Controls :: SqlDataSource Get Output Parameter And Assign To A Var

May 22, 2010

[Code]....

How do I get the "NewID" parameter value form the above datasource and assign it to a select parameter in a different sqldatasource?

View 2 Replies

DataSource Controls :: Set Null Value To SqlDataSource Insert Parameter?

Dec 21, 2010

this is my html code [Code]....

i need to set null value to SqlDataSource Insert Parameter at runtime

i am used this code

[Code]....

View 5 Replies

DataSource Controls :: Output Parameter Not Working To Sqldatasource?

Aug 10, 2010

I am trying to get the uniqueidentifier value from a insert SP and retreive that using a sqldatasource and pass that value to store files in the relevent folder.

the SQL stored procedure

ALTER PROCEDURE [dbo].[sp_InsertIPRT]
@Site nchar(10),
@Description nvarchar(MAX),
@Application nvarchar(MAX),
@Coordinator nchar(50),
@ProjectNumber nchar(50),
@Manager nchar(50),
@DateRequested date,
@DateRequired date,
@Issues nvarchar(MAX),........

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved