|
You're welcome!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Ignore lines with Length == 0?
|
|
|
|
|
How could I have missed that!
Have a five.
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Mmmm.... will it ignore all lines with no printable text?
|
|
|
|
|
|
Well thats what I wanted, not to worry though got it working(ish) that's no longer a problem, Manfreds method worked like a charm now I'm fighting ReadExisting()!!!
Glenn (roll on 5:00 pm )
|
|
|
|
|
In a C# 2010 application, I want to place files in dynamic folder structures that I create in the application. I want to create these dynamic locations so we can place data in the dynamic paths based upon customer name. I also wantto place these dynamic paths in the app.config file.
Thus can you tell me if there is a way to point the app.config file to these dynamic paths? If so can you tell me and/or point me to a reference I can use that will help me accomplish this goal?
|
|
|
|
|
|
Hi jschell,
Any updates to the config file itself will boot off the user using the site as on saving the file, IIS will try to reload that information, in effect ending all user sesisons. I think it would be a better idea to store this information in an application object which can later on be accessed. Let me know if I was wrong or misunderstood your point.
Thanks and Regards,
Thanks and Regards,
Aby
|
|
|
|
|
I make asked to come up with directory paths that look like the followiing:
C://08-30-2012/Customer 1
C://08-30-2012/customer 2
C://08-31-2012/ customer 1
C://08-31-2012/customer 3.
If you can not change the app.config file, how would you change to come up directory path names like I am just displaying?
|
|
|
|
|
Well, the first thing I see there is that you aren't basing the directory structure off the customer name. You are basing it off the date first, so your example doesn't match your stated requirements. Which one is right?
You don't actually need to complicate things like this - all you need to do is create a common root path for the customer data, and then put the customers under that root path. For instance:
c:\App Customers\Customer 1\08-30-2012
c:\App Customers\Customer 1\08-31-2012
c:\App Customers\Customer 2\08-30-2012
c:\App Customers\Customer 3\08-31-2012
Then you can just look for the appropriate customer path. Add yourself a little SQLLITE database and you can store the base path in there, along with any other dynamic information you need.
|
|
|
|
|
That's web.config, not app.config. App.config typically goes with desktop applications.
|
|
|
|
|
Aby Thomas Varghese wrote: IIS will try to relo
First your original post said nothing about IIS nor really even about a server for that matter.
Second however since you already know this then you, presumably, already know that there is not in fact any way for you, in your situation, to write it back to the web.config. So wouldn't that make your original question moot?
Aby Thomas Varghese wrote: think it would be a better idea to store this information in an application object
Far as I can determine your original question was about persisting the information. And presumably, since you can't use the config, then there are any number of alternative possibilities for persisting it. Such as writing to a file or a database.
|
|
|
|
|
The person you replied to wasn't the OP.
|
|
|
|
|
|
Hi,
I am an intermediate programmer i have working knowledge on databases in various programming programming languages. What my problem is I dont know the basics of database connections till now I have just used copy-paste procedure while connecting databases so I want to know the basics of integrating database in my applications. I need the information right from the begining like
1. What is DataSource?
2. What is Data Provider?
etc. important terms that are required initially when we start an application to integrate database
thanks,
Sudhir.
|
|
|
|
|
You would start by reading the documentation, http://msdn.microsoft.com/en-us/library/a6cd7c08(v=VS.71).aspx[^]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
I need to add
using System.Web.Script.Serialization; but when I try to do add reference , it disbaled in .net component. I am using VS 2008.
I read on internet that it is available in 3.5 but in my visual studio some components of 3.5 are enable but some are disables.
I also search my system for System.Web.Extensions.dll and it is present in v3.5 folder.
Please suggest hwo to add?
|
|
|
|
|
You should change the .Net Framework version to .Net Framework 3.5 full, rather than .Net Framework 3.5 Client Profile and then all .Net 3.5 libraries should be available. You can do this in your application properties under the Application tab - Target framework.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
|
Glad to help
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Now email MS and ask them to get rid of the stupid client profiles.
|
|
|
|
|
Sure thing.
....emailing MS
Sorry no reply.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Hi all, I don't know whether this question should be posted here or in a the database forum because it involves both C# and database query statements, but here goes. I am trying to determine if a username password pair exists in the Engineer Table or in the writer table. First I check the Engineer Table for the username password pair using the SQL Count Function. If the pair does not exist then the Count Function returns 0, if it does exist then the Function returns a number greater than 0. I'm using Stored Proc1 to search in the Engineer Table and Stored Pro2 to search in the Writer Table. Below are my stored procedures.
Proc1
SELECT Count(*)
FROM Engineer
WHERE [User Name]= [@UserName] AND [Password] = [@Password] ;
Proc2
SELECT Count(*)
FROM Writer
WHERE [User Name]= [@UserName] AND [Password] = [@Password] ;
The following is my code
public int StaffExists(string myPath, string UserName, string Password)
{
OleDbConnection OleConn = null;
OleDbCommand oCommand = null;
OleDbParameter param = null;
OleConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + myPath + "");
OleConn.Open();
oCommand = new OleDbCommand("Proc1", OleConn);
oCommand.CommandType = CommandType.StoredProcedure;
param = new OleDbParameter("@UserName", UserName);
oCommand.Parameters.Add(param);
param = new OleDbParameter("@Password", Password);
oCommand.Parameters.Add(param);
oCommand.CommandText = "Proc1";
int Count = (int)oCommand.ExecuteScalar();
OleConn.Close();
oCommand.Dispose();
int UserCount = Count;
int UserCount2 = 0;
if (UserCount > 0)
{
return UserCount;
}
else
{
if (UserCount == 0)
{
OleConn.Open();
oCommand = new OleDbCommand("Proc2", OleConn);
oCommand.CommandType = CommandType.StoredProcedure;
param = new OleDbParameter("@UserName", UserName);
oCommand.Parameters.Add(param);
param = new OleDbParameter("@Password", Password);
oCommand.Parameters.Add(param);
oCommand.CommandText = "Proc2";
UserCount = (int)oCommand.ExecuteScalar();
OleConn.Close();
oCommand.Dispose();
UserCount2 = UserCount;
if (UserCount2 > 0)
{
}
else
{
}
}
return UserCount2;
}
}
The problem is no matter what username or password is entered they come back as invalid. Please help, thanks in advance.
|
|
|
|
|
The [] brackets around the parameters look strange. What about
WHERE [User Name]= @UserName AND [Password] = @Password
|
|
|
|