|
This all looks very bizarre. Please post a sample of the actual data returned from teh database. Don't format it, just post it here as it is stored in the table. You will get a far better solution than the one you are using at the moment.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
the result i given u is part of the actual result taken from db to aspx page...
in aspx page the syntax is :
<asp:label id="Change1" runat="server" text="<%# ConvertRM(DataBinder.Eval(Container, "DataItem.Change")) %>">
i using datagrid to populate the data's.
anything else u need bro??
|
|
|
|
|
the result i given u is part of the actual result taken from db to aspx page...
in aspx page the syntax is :
<asp:Label ID="Change1" runat="server" Text='<%# ConvertRM(DataBinder.Eval(Container, "DataItem.Change")) %>'></asp:Label>
i using datagrid to populate the data's.
anything else u need bro??
|
|
|
|
|
it seems i cant post the aspx tag.....
|
|
|
|
|
VinothRao wrote: Operator '<' cannot be applied to operands of type 'object' and 'int'
You have to cast the object type to float.
protected string ConvertRM(object number)
{
float FNumber = (float)number;
if ( FNumber < 0 )
return "0";
else
return "1";
}
|
|
|
|
|
Compilation was having error after i put up ur code
It says "Specified cast is not valid"......
|
|
|
|
|
ok it seems i found the solution.
protected string ConvertRM(object number)
{
if (number == DBNull.Value)
return "-";
else
if (number.ToString().StartsWith("-"))
return String.Format("{0:F4}", number);
else
return String.Format("+{0:F4}", number);
}
i replace Contains("-") to StartsWith("-")....it looks working....
thxxx 4 d help......
|
|
|
|
|
Your earlier post[^]
I posted an answer here on your earlier post
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Hi to all,
i have developed one web application with login page. Everything is working well on standalone PC but while on network if somebody logs in with a particular username & password and someone else tries to login on another PC then it automatically logs in with the username of person who is already logged in.
i have used cookies for my login page. Can anybody please tell what is the mistake?
Pravin
|
|
|
|
|
i think the problem is different than cookie as cookies are stored at client side by the browser.
Are you using any static variables or something like that in login page
Again how are you using the cookies in your application ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I think that there is some problem while creating the application object and session object.
Application object is created for the application(only one) while session objects are created for ecah user separately, that keeps track of the user.
Deepak Nigam
|
|
|
|
|
hi Deepak,
Thanks for reply... can you please tell me how to create session object for each user separately?
or do u have any link for it?
Please reply.
Pravin
|
|
|
|
|
hi,
in the database..i have a field named username(in the table)..........
these values should be displayed in the textboxes(aspx page)......but i dont have the textboxes in aspx page(means i have not created statically)..but these textboxes should be created dynamically ....if the username has three fileds then 3 textboxes has to be generated with username values..
how can i do this ?
Ramesh
|
|
|
|
|
beklo.com/rameshgoudd wrote: .if the username has three fileds then 3 textboxes has to be generated with username values..
3 rows ?
|
|
|
|
|
|
Use a Gridview/DataGrid , put a TemplateColumn and add a TextBox there. Bind Gridview/DataGrid with data from the table. It will give you 3 TextBoxes(depends on no of rows returned).
|
|
|
|
|
take one gridview control and one textbox in ItemTemplte and bind with the dataset.
beSt ReGard
PathAn.
|
|
|
|
|
please give me the code for using checkboxes in dropdown list
its urgent! please help.
alok
|
|
|
|
|
alok2171 wrote: checkboxes in dropdown list
|
|
|
|
|
Well never tried coding it.
But yes..you can find something similar in AjaxToolkit.
Its PopUpControl. I guess its something similar you would like to have.
Hope it helps you
Cheers
Menon
|
|
|
|
|
this is available in C# 3.0 Windows template but i think this is not available with you.
You will have to create your own control by rendering it.
Google the subject you can also find third party controls that you can use
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I have the below code in my code-behind file.
protected string ConvertPercent(object number)
{
if (number == DBNull.Value)
return "-";
else
return String.Format("{0:F}", number);
}
Currently only negative numbers having '-' sign.
How can i make positive numbers having '+' sign?
Thx....
|
|
|
|
|
try
private static string FormatMyNumber(object Number)
{
float myFloat;
if (!float.TryParse( Number.ToString() , out myFloat))
return "ERROR";
if (myFloat < 0)
return string.Format("{0:F}" , myFloat);
else
return string.Format("+{0:F}" , myFloat);
}
There are most probably better ways, but it's too early for me at the moment...
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
|
deepaknigam11 wrote: SqlConnection con;
string str= ConfigurationSettings.AppSetting["Coonectionstring"];
con=new SqlConnection(str);
This looks fine. Have you checked the spelling ? Try printing str and check what you are getting over there
|
|
|
|