|
In my prject I used the stored procedure which I sent you ealier which calculates the date differnce also.
.I attached that datasource to gridview. my gridview looks like this.
Css Field received Id Wait Time
6/13/2007 12:38 am 1123 3d 21h 45m
6/13/2007 10:45 1124 2d 30h 07m
In "CssField" in GridView I have to use colors based on the following condidtion
If Wait Time >= 24 hours then color = Red
>= 20 hours Orange
>= 16 hours yellow
Also How can I use the above condition for putting different colors in all rows based on WaitTime field.
The following is my CSS class.
.sdgStatusRed {
background-color: Red;
height: 25px;
width: 25px;
}
.sdgStatusOrange {
background-color: Orange ;
height: 25px;
width: 25px;
}
.sdgStatusYellow {
background-color: Yellow;
height: 25px;
width: 25px;
}
.sdgStatusGreen {
background-color: Green;
height: 25px;
width: 25px;
}
.sdgStatusBlue {
background-color: Blue;
height: 25px;
width: 25px;
}
seema
|
|
|
|
|
If you have ccs classes for this, then make your CssClass equal to a method call which passes in the value of the WaitTime field. Then, in your code behind, return the correct string ( class name ) based on the value passed in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want values entered into a textbox to appear in currency format with comma separator and 2 decimal places, when the textbox lost focus
pls help
t.aransiola
|
|
|
|
|
As you're using ASP.NET, you'll need to handle the focus lost event in javascript and write code to format the string there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have the following query. my message field is of datatype text. But I want to grag just first 50 characters + ...
from that "message" field. How can I do that.
The following is my sql statement
select tck.ticketid,tckmsg.message
from tbtickets tck inner join tbticketsmessages tckmsg
on tck.ticketid = tckmsg.ticketid and tcktstatusId = 1
seema
|
|
|
|
|
seemamltn wrote: How can I do that.
Maybe by posting it to the correct forum. Try SQL / ADO / ADO.NET
only two letters away from being an asset
|
|
|
|
|
Hello all,
I have a small site that needs to hit Active directory. I added a project reference to my website for System.DirectoryServices. I also added a using statement to the code behind page as you would normally expect. Now, however, I get an error when I try to run a page that is dependent on a file in App_Code that references the System.DirectoryServices assembly. Even though the assembly is referenced by the project, it still isn't picking up the reference for the items in App_Code. Any ideas?
Thanks,
Will
|
|
|
|
|
What error it says when you run your application?
Regards,
Satips.
|
|
|
|
|
Whoops. I guess I should have included that information:
Server Error in '/' 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: CS0234: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 8: using System.Web.UI.WebControls.WebParts;
Line 9: using System.Web.UI.HtmlControls;
Line 10: using System.DirectoryServices;
Line 11:
Line 12: namespace PearWeb.App_Code
Source File: c:\SVN\PEAR\Source\PearWeb\App_Code\ADHelper.cs Line: 10
|
|
|
|
|
Just Remove the Reference from that folder and once again add the reference to that folder and try again.
Regards,
Satips.
|
|
|
|
|
|
Assembly references are added to projects, not folders.
only two letters away from being an asset
|
|
|
|
|
|
The strange thing (to me, at least), is that the error is a compilation error. Since the System.DirectoryServices dll is in the GAC, it looks like it would be trivial to retrieve from a web application for compilation purposes. I also tried adding a line in the <assemblies> key of the web.config, but I only succeeded in making the app crash earlier, as it says it can't load the assembly at all. The odd thing is that I can use exactly the same code in a web page, and there is no problem at all.
|
|
|
|
|
Ok.... I fixed it, but I don't understand why my fix worked. I set Copy Local on the reference to true. Then, I rebuilt and suddenly it works. Ummmm....Why?
|
|
|
|
|
When I said that it works, I meant that it doesn't blow up. However, the stuff in App_Code is no longer accessible from the rest of the project. I think I might do better to just switch over to a web application project or something.
This makes me want to switch over to ROR instead of bothering with C#, as it seems that I'm spending more time trying to make Visual Studio play nice than I am actually coding. It's hitting the point that it would be an improvement for me to just develop using a terminal and a text editor, which is what I use in Ruby.
Visual Studio 2005 reminds me of Rain Man a little more every time I use it. Sure, it can do impressive stuff that others can't do without a lot more work, but it has an apoplectic meltdown if you don't buy your underwear at Target.
|
|
|
|
|
Can Crystal Report show dynamic picture?
Is anyone know?
thank you
|
|
|
|
|
Use a typed DataSet, put the graphic in the DataSet and use the DataSet as DataSource for the Crystal Report.
So we can make it as Dynamic.
Hope this will help you.
Regards,
Satips.
|
|
|
|
|
Hi, I've found the function below when I was searching for ways to prevent SQL Injection. Basically it is supposed to remove the words select, drop, inser, delete, and other characters that can affect your database. I'm new to VB.NET and ASP.NET so please bear with me.
function killChars(strWords)
dim badChars
dim newChars
badChars = array("select", "drop", ";", "--", "insert", "delete", "xp_")
newChars = strWords
for i = 0 to uBound(badChars)
newChars = replace(newChars, badChars(i), "")
next
killChars = newChars
end function
I get the error message "array is a type and can not be used as an expression". I also noticed that the datatype for the variables badChar and newChars were not specified and VS2003 says the variable "i" in the for loop was not declared. I have seen vb.net For loops used the way its being used in the function above without generating errors. Please help clarify, thank you in advance for your help.
|
|
|
|
|
If you want to prevent SQL injection attacks then don't accept SQL statements period, use store procedures or parameterized queries.
only two letters away from being an asset
|
|
|
|
|
Use Stored Procedure.
Then you will not get these error.
Regards,
Satips.
|
|
|
|
|
Gee, wish I had said that...oh I did, 1 hour 20 minutes ago.
only two letters away from being an asset
|
|
|
|
|
LOL - yeah, I sometimes give an answer where the correct answer has been given, but I feel I can expand on it. Some people seem to just reiterate answers tho, some posts get 6 or 7 answers, all the same, hours apart. Go figure
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Helloo Iam delpoy my web application(asp.net 2.0)
and gives following error
is it possible that bcz the server dont support .net 2.0
???????
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load the assembly 'WebSite8_deploy'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="Default3, WebSite8_deploy" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File:-----\test\Default3.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2379; ASP.NET Version:1.1.4322.2379 <<<<------------------- look here
aj123
|
|
|
|
|
Well - does the server have .NET 2.0 installed? Would seem like an obvious requirement to me....
|
|
|
|