|
Retriving more than one Image and looping through the Images is of no use. Anyway your Response.Binary() will write to the client once. Next time when you again execute the Response.binary() it will overwrite. It would be better if you seperate the Image retriving code in a seperate class file and use it. And Most importantly read some articles about 3-Tier Architecture and try to seperate your DataAccess code from Presentation Layer.
Regards - J O H N -
|
|
|
|
|
hi Jon
Thanks for your reply and Tips i will work on using Layers and if u have any good link for practicing layers let me know i want some links.
sathimailin
|
|
|
|
|
Check this article[^]. Hope It will give you a basic understanding about the N-Tier architecture.
Regards - J O H N -
|
|
|
|
|
|
Hi,
This is from Chandrakanth.
Actually i have done Mailing System.It is working fine.
And i want attach a file with Mail.
How can i attach a file with Mail.
Can any one tell me how to attach a file
Thanks And Regards
Chandrakanth.
Chandrakanth
|
|
|
|
|
System.Web.Mail.MailMessage m = System.Web.Mail.MailMessage();
m.Attachments.Add();
|
|
|
|
|
Hi,
i have the below code in my page.
protected string ConvertPercent(object number)
{
if (number == DBNull.Value)
return "-";
else
if (number == float.Negative)
return "0";
else
return "1";
};
i want the "0" to be return incase NUMBER having negative (exp: -1.236)
i want the "1" to be return incase NUMBER having positive (exp: 1.236)
Please help me......i dont know the syntax for this....thxxx
|
|
|
|
|
VinothRao wrote: protected string ConvertPercent(object number)
{
if (number == DBNull.Value)
return "-";
else
if (number == float.Negative)
return "0";
else
return "1";
};
Is this code working?
If no try following code
this is not a proper way to identify number is negative or positive but it will work.
if(number.ToString().Contains("-"))
return 0;
else
return 1;
best regard
pAthAn
|
|
|
|
|
wow.....so easy the syntax.....thx a lot brooo
no my code wont work becoz actually i just put the syntax there to show clearly what is was looking for....
thx 4 ur code......it works perfectly.....
|
|
|
|
|
Imran Khan Pathan wrote:
if(number.ToString().Contains("-"))return 0;elsereturn 1;
I assume you are taking the **** here? Convert a number to a string, checking if the string starts with a 'minus' symbol to determine if it is negative or not?
"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."
|
|
|
|
|
VinothRao wrote: i want the "0" to be return incase NUMBER having negative (exp: -1.236)
i want the "1" to be return incase NUMBER having positive (exp: 1.236)
if (number < 0)
return 0;
else
return 1;
You need to cast number from object type to float before doing checking
|
|
|
|
|
i did that before.......but was encounter error........
Operator '<' cannot be applied to operands of type 'object' and 'int'
Brooo.....after implement ur code into my page.....got some confusion happen with the result....c below....
Grp1 +0.0071
Grp2 0.0001
Grp3 +0.0047
Grp4 +0.0041
Grp5 +0.0038
Grp6 0.0001
Grp7 +0.0005
for the data 0.0005 it has + sign.......but for data 0.0001 dont have....any idea???
Below is the code.
protected string ConvertRM(object number)
{
if (number == DBNull.Value)
return "-";
else
if (number.ToString().Contains("-"))
return String.Format("{0:F4}", number);
else
return String.Format("+{0:F4}", number);
}
|
|
|
|
|
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
|
|
|
|