SQL Server :: Change Value On A Variable?

Nov 25, 2010

If SubTotal is more than 500 I want @freightPrice to be 0. How can I do that?

[Code]....

View 4 Replies


Similar Messages:

C# - Hidden Variable Vs Server Variable Accessing On Client Side In Javascript

Jul 14, 2010

I'm evaluating two options of accessing a server side data on client side. Little bit confused about the efficiency or may be you can call it as finding best approach to do it.

I need to access a server side data may be an integer value in javascript on client side. I know about two options to do it.Create a public variable or property on server side and set it to javascript variable on client side as below:

var value = eval(<% =value %>);

Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().

Which is the best approach and what are the pros and cons?

View 1 Replies

Change Variable Color And Size?

Dec 6, 2010

How would I change "newTicketId" to a bigger font and color blue?

[code]....

View 2 Replies

How To Change Application Variable Value On Closing Browser

Jun 11, 2010

I want to Change application variable value on closing browser, Problem is; I am using sessionState mode="StateServer" and in this mode, Session_end event does not fire in global.asax

how i can detect session_end or browser close and then change the application variable?

View 1 Replies

How To Change The Format Of DateTime.Date Variable

Oct 18, 2010

I want to save the current date to a table in database. The coloumn type is declared as DateTime in the table, as i may have to select rows between two dates. So i can't change the format by converting it to string variable. I want the DateTime.Date variable to have dd/MMM/yyyy hh:mm tt format instead of MM/dd/yyyy hh:mm:ss tt format.

View 3 Replies

From One ASP Page To Other With Variable And Change Connection String?

Nov 22, 2010

i have 2 ASP pages in first page the user choose the database name and in other page take the database name and change the connection string to other databasehow i can pass a variable from one page to other by button click and how i receive this variable in other page and how to change the connection stringthe connection string is in web.config like this:

<connectionStrings>
<add name="Northwind" connectionString="Provider=sqloledb;Data Source=.;Initial Catalog=Northwind;User Id=sa;Password=sa; Connect Timeout=10"/>
</connectionStrings>

View 1 Replies

Web Forms :: How To Change The Text Of A Linkbutton By Referring To It Through A Session Variable

Oct 19, 2010

I want to change the text of a linkbutton by referring to it through a session variable.

For example how could a normal Linkbutton1.text = "buffoon" be referred to by a session variable if the Session("LinkButton") = "LinkButton1" ?

I am envisioning something like: LinkbuttonByName(Session("Linkbutton").text = "bufoon" .... but don't know how

View 6 Replies

Access Dropdown Menu's Variable In Java Script On Change Event

Jun 11, 2010

I want to access drop down menu's variable in java script on change event, here is my code

<asp:DropDownList ID="DropDownList1" runat="server" onchange="document.location.href = url_Lookbook;" >
<asp:ListItem Value="0">hello</asp:ListItem>
<asp:ListItem Value="1">world</asp:ListItem>
</asp:DropDownList>

here is the script coding:

<script type="text/javascript">
var url_Lookbook = "http://microsoft.com";
</script>

My question is how do I pass down value=0 or value = 1 to different page

View 3 Replies

Forms Data Controls :: Detailview Text Color Change Based On Variable?

Feb 15, 2010

I'm trying to change a row in detailsview based on a value in a coloum. Exactly the same as this example but in Detailsview: [URL]

View 3 Replies

State Management :: Session Variable Worked On One Prod Server But Not On Another Server?

Nov 3, 2010

We recently migrated a web app from one Prod server (Prod 1) to another server (Prod 2). There is a session varialbe checked inside the page load event of the default master page. I have enabled session state both in web.config as well inside the pagedirective. The compilation went through without any issue. The web app is also running just fine on the server but the log file keeps logging a warning message. There is no run time error.

"System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration."Any idea why this is happening on one server vs other?

View 3 Replies

Forms Data Controls :: GridView Header / Change The Header Based On The Session Variable

Feb 16, 2011

I am using the following code to change the header based on the session variable

[code]....

View 2 Replies

C# - How To Change The Image Url Of An Image Based On #var=test Variable

May 19, 2010

I'm trying to change an image's imageurl on an aspx asp.net c# page based on a variable from #var=1` (or 2, or 3, or 4)

I know nothing about javascript unfortunately which is what I've been told I need. Can anyone point me at a novice based script I can try to learn via implementation?

View 2 Replies

SQL Server :: Use Variable In XQuery?

Sep 22, 2010

I want to use a local sql variable in XQuery.

Following is my table structure with columns and data type.

Orders
ID
Uniqueidentifier
UserID
Uniqueidentifier
OrderDetail
XML
OrderDate
DateTime

OrderDetail column contains XML in the following form.

<Books>
<Book BookID="033ba62a-3bbe-48cc-ad15-c3f28ff86306" Title="XYZ" Price="120" />
<Book BookID="805BC2BE-A91E-4E0E-A99E-C290D2EEEFF6" Title="XYZ" Price="120" />
</Books>

I want to select Orders (rows) which have BookID = "033ba62a-3bbe-48cc-ad15-c3f28ff86306". I am able to achive it through the following query.

Select * From Orders Where OrderDetail.exist('//Book[@BookID = "033ba62a-3bbe-48cc-ad15-c3f28ff86306"]') = 1

Now the issue is I want to use an sql local variable (@BookID) instead of the hardcoded BookID.

So How I can use a sql variable in a XQuery.

View 2 Replies

SQL Server :: To Pass A Table Type Variable To A Table-Valued UDF In SQL Server 2005?

Nov 25, 2010

I need to pass a table type parameter to a user-defined table valued function in SQL Server 2005.How would I do this?

My function name is udf_t_GetSales ( @financialYearMonthsData as table)

The table @financialYearMonthsData has 3 columns ( MonthId int, DisplayText nvarchar(500), CalendarYear int)

View 7 Replies

SQL Server :: Store Output (As SQL) In Variable

Jan 21, 2011

[Code]....
Above is dynamic sql and when it is executed by sp_executesql then I got output as as xml. If I want to store that XML in a variable. So then what I need to add in my tsql script.

View 1 Replies

How To Access Server Variable In Aspx

Dec 6, 2010

I've defined a session variable in my Session_Start procedure

void Session_Start(object sender, EventArgs e)
{
<other stuff>
string sAdmin= bAdmin.ToString();
Session["SessionAdmin"] = sAdmin;
}

Then in my masterpage I want to use the Session Variable to conditionally show some links in a list.

How do I write the Boolean expression to correctly access the session variable SessionAdmin?

Here's what I have:

<div id="menu">
<ul>
<li><a href="/EmployeeTime.aspx">Employee Time</a></li>
<% if ( *** a Boolean expression involving Session variable "SessionAdmin" *** ) {%>
<li><a href="/Employee.aspx">Employees</a></li>
<li><a href="/ProductLine.aspx">Product Lines</a></li>
<li><a href="/Task.aspx">Tasks</a></li>
<li><a href="/Type.aspx">Work Types</a></li>
<li><a href="/Activity.aspx">Activities</a></li>
<%} %>>
</ul>
</div>

How do I correctly define my boolean expression? I've been looking, but haven't found the right syntax.

View 1 Replies

SQL Server :: Using Session Variable In Asp:SqlDataSource

Oct 8, 2010

I want to use session variable for ConnectionStrings in SqlDataSource, so the same script can be used with different users with different databases. My SqlDatasource code is :

<asp:SqlDataSource
runat="server"
ID="sdsAvdeling"
SelectCommand="SELECT
* FROM [Avdeling] ORDER BY [Avdeling]"
ConnectionString="<%&#36;
ConnectionStrings:UtstyrConnectionString %>">
</asp:SqlDataSource>
In Page_load, I assign the connectionstring for the SqlDataSource like:
sdsAvdeling.ConnectionString = Session["ConString"].ToString();
where
Session["ConString"]

is assign to "UtstyrConnectionString" when the the user logs in. When running the script, I get the following error: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

View 4 Replies

SQL Server :: How To Declare Scalar Variable

Aug 5, 2010

how to Declare scalar variable

[Code]....

View 6 Replies

SQL Server :: Setting Value From Query To Session Variable

Mar 11, 2011

I would like to run a SQL query on the codebehind VB page that will also set a value from that query to a Session variable. Also, this needs to be done on the Page_Load.
Example:
[Code]....

View 3 Replies

SQL Server :: How To Pass Variable Into Query In ASPX

Oct 26, 2010

sales.aspx.vb
Custom function which stores the current DATE into todayDate. I use this function to convert system date into SQL friendly date.
sales.aspx
I used Data Grid and SQL Data source.
SelectCommand="select * from sales where aab = 110026"
I want my select statement should take the date from todayDate.
i.e.: SelectCommand="select * from sales where aab = todayDate"
How to write this statement in correct syntax.

View 4 Replies

SQL Server :: How To Store Query Result In Variable

Oct 7, 2010

i am wishing to store the query result in any variable, have look at below code.

[Code]....

I have marked the code with bold, where I am getting error.

how do I store query result in any variable.

View 8 Replies

SQL Server :: Using Session Variable Value In An Insert SQL Statement?

Jan 7, 2011

This should be really simple and I am new to asp development.

I am using ASP log in controls..when user logs in, I am storing the userid in a session variable. On this another page, I want to put the previously stored session variable value into a table using Insert statement.

in my sqldatasource..here is the code..

InsertCommand="INSERT INTO tblMain(PatientId, UserId, IncAge, IncDeNovo, IncAnginaIschemia, IncNative, IncLesions, IncStudyConform, IncStenosis) VALUES (@PatientId, @UserId, @IncAge, @IncDeNovo, @IncAnginaIschemia, @IncNative, @IncLesions, @IncStudyConform,
@IncStenosis)">

View 2 Replies

Empty Diagnosis Or Lack Of One Variable In SQL Server?

Sep 23, 2010

I want to recongize that a nvarchar variable in stored procedure is null or not null.

and this example :

DECLARE @Count int;

SET @Count = (SELECT Count(Fld) FROM Tbl)

if there is no row how much whould be the value of @Count?????

zero or null?

View 6 Replies

SQL Server :: In Sql Function Check To See If Variable Is Null?

Feb 4, 2011

Inside a function I need to check to see if a variable value is null, how to do this? I implemented the code but its not returning the value I thought it would return.If it's null I want to set the value of the variable, else I want to query the value from a table

[Code]....

View 5 Replies

SQL Server :: Declaring Variable In Stored Procedure?

Feb 16, 2011

I have this procedure

[Code]....

I don't know what variable should be put in where clause for tblVisitor.visitorID because there's a variable that was already passed by an output identity parameter by a different stored procedure. What will I put in the where clause for visitor id?

View 3 Replies







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