|
Hi I need scrollbars on top of my page also...,
How to do that?,
Regards,
Magi
|
|
|
|
|
Write your page upside down then turn your monitor upside down as well.
|
|
|
|
|
iam working on web parts .i kept the label in webpartzone .after debugging iam not getting the minimize button (down arrrow in the label)how can i resolve this problem
|
|
|
|
|
hi,
i got the below code in my page.
protected string ConvertPercent(object number)
{
if (number == DBNull.Value)
return "-";
else
if (number.ToString().StartsWith("-"))
{
ChangePercent1.ForeColor = Color.Red;
return String.Format("{0:F}", number);
}
else
ChangePercent1.ForeColor = Color.Black;
return String.Format("+{0:F}", number);
}
but it seems i getting an error saying
"Object reference not set to an instance of an object"
The ChangePercent1 was initialize using
public System.Web.UI.WebControls.Label ChangePercent1;
BUT still errors persists. Please help me.....
Thx.
|
|
|
|
|
What a disaster.
Why are you using ToString ? Why are you passing an object ?
If number == null, this code will give that error. If you're using .NET 2.0, I'd suggest passng an int?, checking for null, then using if number < 0 instead of a tostring call that may not work for all locales and is needlessly expensive.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hy
I have a site on a host for ASP.NET.
I have a file with 30000 records.
I have a .mdf file with a table with 30000 records.
Method 1
I read from file a record and diplay in a label.
Label1.Text = File.ReadAllLines(Server.MapPath("~/fisier.txt"),Encoding.UTF8)[index];
Method 2
I read from .mdf file from my table the same record.
Can tell me witch of the 2 method is faster?
thx
|
|
|
|
|
Probably the second, but both are a disaster, obviously.
Well, readalllines returns a string[] as I recall, so it won't compile. ReadAllText is probably faster than the database solution, as it mindlessly reads and passes a single string.
This does NOT mean that flat files are faster than databases.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Method 2 is by far the most efficient. A specific record in the table can be accessed directly without having to read all of them.
The ReadAllLines method will read the entire file and create an array that contains 30000 string objects. The memory used for this will be approximately double the file size, plus 120 kB for the array object itself.
A less wasteful method to read the file would be to use a StreamReader to read line by line until you reach the line you want. That will not create a huge array in memory, and you don't have to read the entire file.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
hi
i want to save a file to server. this is the code i'm using in my project.
if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
{
string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
string SaveLocation = Server.MapPath("Data") + "\\" + fn;
try
{
FileUpload1.PostedFile.SaveAs(SaveLocation);
Response.Write("The file has been uploaded.");
}
catch (Exception ex)
{
Response.Write("Error: " + ex.Message);
//Note: Exception.Message returns detailed message that describes the current exception.
//For security reasons, we do not recommend you return Exception.Message to end users in
//production environments. It would be better just to put a generic error message.
}
}
else
{
Response.Write("Please select a file to upload.");
}
'Data' is afolder in the server. iwant to store the file in that folder. but its not working properly. its showing a config error while running. is there any additional settings needed?
|
|
|
|
|
mukesh.mr03 wrote: Server.MapPath("Data") + "\\" + fn;
Why not use Path.Combine ?
What error ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what you mean by Path.Combine. Can you please send me some sample codes for this?
this is the error while running the application:
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customerrors mode="Off">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">
|
|
|
|
|
If you read the error, it's telling you to change our config so that you can see the actual error.
Path.Combine is in System.IO and will turn two strings into a single path.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
mukesh.mr03 wrote: if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
if(FileUpload1.HasFile)
{
}
mukesh.mr03 wrote: string SaveLocation = Server.MapPath("Data") + "\\" + fn;
SaveLocation=Server.MapPath("Data/" + fn);
beSt Regard
pAthan
|
|
|
|
|
Hi Plz refer this following site
[^]
In this using usercontrol they displayed tabstrip...,
When we will click that itemtemplate links displaying the pages in content.aspx page...,
It will displays in iframe place...,
I too displayed like that my forms...,
Now my quest is,
While scrolling that iframe form page...,
I am getting some of my tools displaying above the usercontrol itemtemplates...,
How to solve that probs...,
Plz any one hlp me...,
Regards,
Magi
|
|
|
|
|
Please don't use textspeak. You might want to ask the author of the article you referred to.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi frns
i have created an application for uploading a file in ASP.net2.0 with VB its working fine. the actual task was to provide a file upload option to a client, when the client uploads the file the file should be stored in the server system in the specified location and also i maintain a database table with the title of the file which is primary key and path of the file and created date.
all these i have done but the problem is, when i upload the same file with other content or same content in it the file getting overwritten in the server system. so, i want to solve this problem.
i want to verify the file name before i insert the file into server system
|
|
|
|
|
sunilwise wrote: i want to verify the file name before i insert the file into server system
if (!File.Exist(Server.MapPath(YourvirtualPath)))
else
|
|
|
|
|
thanks for ur reply
i used
if (!File.Exist(Server.MapPath(YourvirtualPath)))
//Do file saving here
else //inform user
it says leading '.' or '!' can only appear inside with statement
so i made above code to
if (File.Exist(Server.MapPath(YourvirtualPath)))
//inform user
else
//Do file saving here
then also it is not working i tried to insert the file with same name the code is running into else part where as it has to be in the if condn what should i do plz help solve this problem
|
|
|
|
|
thank you dear i got it thanks for your help
|
|
|
|
|
File.Exist("FileName") is used to check the file is exist in the folder or not.
bEst Regard
pAthAn
|
|
|
|
|
thanks for ur reply
i used
if (!File.Exist(Server.MapPath(YourvirtualPath)))
//Do file saving here
else //inform user
it says leading '.' or '!' can only appear inside with statement
so i made above code to
if (File.Exist(Server.MapPath(YourvirtualPath)))
//inform user
else
//Do file saving here
then also it is not working i tried to insert the file with same name the code is running into else part where as it has to be in the if condn what should i do plz help solve this problem
|
|
|
|
|
How to deploy a project with .mdf file .is any problem occurs if a system contains only sql server 2000.i done the pjct in .net with sql server 2005 express edition for setting the roles management.when i deploy it into net any problem occurs .please reply detaily to this query
|
|
|
|
|
Wow. I can't work out what your queston is. An mdf is an Access database. If you built your app with SS2005, then SS2000 is probably not going to work.
SreejithAchutan wrote: when i deploy it into net any problem occurs
That has to be the vaguest problem description I have ever heard.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Any method to solve this problem.how we deploy a file with .mdf in ss2005 mistake occurs whn we host the pjct containing the .mdf file.is it work same as we deploy through sql server database.
|
|
|
|
|
What do you mean by 'mistake occurs' ???
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|