|
I am trying to programmatically change the IIS settings for a folder. I have been following the following article, which shows how to use the DirectoryEntry class to manage active directory settings: http://www.codeproject.com/KB/system/everythingInAD.aspx#10
This code has been working to change the settings for the root directory of my folder, the IISROOT/MyAPP folder. My problem is that I need to change IIS settings for the IISROOT/MyAPP/Child folder, but have not been able to get a handle to the child folder using the DirectoryEntry. Is there a way that I can get a DirectoryEntry variable for this child folder, so that I can change the appropriate settings?
|
|
|
|
|
I figured it out. Before setting the path for the MyAPP directory, I created the child directory as an "IIsWebDirectory". When I properly set the path for the parent, the child directory was appropriately filled with files.
|
|
|
|
|
I want to genericize a class so that it can be used in any application. This class loads application settings. The problem is that in order to load the application's settings, I have to use the application's namespace (?) to do it, like so:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
somevar = MyApp.Settings.Default...
}
}
}
How do I change it to something like this:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
myapp = SomeMagicHappensHere();
somevar = myapp.Settings.Default.blah blah blah
}
}
}
When I hover over MyApp in the constructor show in the first example, it shows the type as "namespace", but I apparently can't cast to that type (or I'm doing it wrong).
Can anyone help?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John,
Right, MyApp is the namespace, just like System is the namespace for System.String. Namespaces aren't types by themselves, so you can't do things to them like you would to classes.
Would something like this work?
public AppSettings(ApplicationSettingsBase settings)
{
} ApplicationSettingsBase is the base class for all project settings. You would construct your AppSettings class like this:
AppSettings settings = new AppSettings(MyApp.Settings.Default); Is that what you're looking for?
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Trees/Forest/Blind - many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In C:\abc\PiPe Modules\pipe\PiPe\source: "C:\Program Files\CVSNT\cvs.exe" -q update -P -d
ObjectFlatten.cs
CVSROOT=:pserver:vgcoder2@192.168.2.137:2401/piperoot
C ObjectFlatten.cs
Error, CVS operation failed
Tortoise Tip: One or more of your files has a conflict. This means that someone else has altered the
same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve
the conflict.
Unable to understand what the problem could be
|
|
|
|
|
humayunlalzad wrote: Unable to understand what the problem could be
I'm guessing that it might be:
humayunlalzad wrote: One or more of your files has a conflict. This means that someone else has altered the same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve the conflict.
|
|
|
|
|
I assume CVS is your source code evrsion manager, so the answer is really in the Tortoise Tip -
humayunlalzad wrote: One or more of your files has a conflict. This means that someone else has altered the same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve the conflict.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You know how the xml writer automatically makes the ampersand character (&) into it’s character entity reference ‘&’. Is there anyway of preventing it from doing this. I am working with an application that does not read the file the xml writer creates with an xml parser, therefore the character entity reference ‘&’ reference never gets parsed back to an ampersand. This is causing an error with the application because it does not understand the ‘&’.
|
|
|
|
|
IF you dont quote & it is not valid XML any more.
But if you really want it, just write out the file using the XmlWriter, and then just read over the created file/stream and replace & with & .
|
|
|
|
|
Fix the application that does the reading.
|
|
|
|
|
Hello gurus,
I have a request for you.
I have imported a flat file (delimited text file) into a DataTable from a DataSet . I wish to run an SQL statement such as "SELECT toto as X, count(titi) as Y from MY_TABLE GROUP BY X, ORDER BY X" where 'toto' and 'titi' are field from the MY_TABLE.
How is it possible to do that in C#?
I hope my question is clear. If not, let me know, I'll try to explain in better way.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
You can use LINQ for that if you have VS2008, else it's not really possible.
|
|
|
|
|
hi bouli
Firstly your Question is not Clear , you have imported a Flat File into a Datatable from a Dataset, its not making sense at all. Please Tell us Step by Step and show us your code, where you import and so we can understand what you mean and we will take it from there.
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Okay,
Sorry for my poor english.
I have sucessfully imported a CSV file into a DataSet .
I need to execute an SQL statement using COUNT , GROUP BY and ORDER BY . The request is done and works fine. I need to run it in C#.
While the data remain in a DataSet , I would like to know how I can execute the SQL statement on this DataSet?
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
Hi man
here is the Code.
public Dataset GetData()
{
Dataset dsdata = new Dataset();
String Constr = @"User ID=sa;Password=;Database=MyDB; Server =MYSERVER";
SqlConnection con = new SqlConnection(Constr);
SqlCommand cmdselect = new SqlCommand("SELECT toto as X, count(titi)as Y from MY_TABLE GROUP BY X, ORDER BY X");
cmdselect.CommandTimeout = 0 ;
cmdselect.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmdselect);
da.Fill(dsdata);
return dsdata;
}
Tell me if you have Problems (vuyiswamb) Skype
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
As I said, the data are already in a DataSet loaded in memory from a CSV file and not in a database.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
ok,
I was showing you, if the data is already in the dataset. then your Dataset will have a name and a datatable, then from the above code.
see , you will end up with a dataset object.
Dim strFileName As String = "MyFile.csv"
Dim strPath As String = "C:\"
Dim strCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" + strPath + ";Extended
Properties='text;HDR=Yes;FMT=Delimited'"
Dim con As New OleDbConnection(strCon)
Dim cmdGetCsv As New OleDbCommand("SELECT * from " +
strFileName, con)
Dim csvAdapter As New OleDbDataAdapter(cmdGetCsv)
'Dim csvReader As OleDbDataReader
con.Open()
Dim dsCsv As DataSet = New DataSet
csvAdapter.Fill(dsCsv)
you can change your Select statement to your liking.
Hopr this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
I have a web service that references the DLL. Inside the DLL I make a connection to a database, and do some data manipulation. However, for some reason I can not establish the connection. (DLL is a COM object).
On the other hand if I just use a simple windows forms application and reference the same DLL, I connect with no problems.
It seems that I am missing some settings or something.
Really need help.
Thank you!
|
|
|
|
|
What is the error? What exceptions are being thrown?
|
|
|
|
|
The exception that it's throwing is the Time out exception.
Thank you
modified on Monday, June 9, 2008 10:12 AM
|
|
|
|
|
Hi zaboboa
If you can just post your code , it will be easy for us to help you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi!
Unfortunatelly I have no control over the DLL that I am using.
The method in DLL will return the ADO connection object.
It's working fine when I reference it from Windows Form Application (connection object is returned), and not fine (get the Timeout Exception) when referenced from Web Service running on my local machine.
So, I guess my question is what is the difference in referencing components from Web Service and Windows Form application?
Thank you.
|
|
|
|
|
hi man
I understand your Problem. What you receive is the timeout in the Command object. I hear you say you have no Access to the DLL code. So that means you have little to do with that Problem. i will tell you what did the person who write the DLL missed.
CommandObject.CommandTimeout = 0;
Atleast microst Recomend it, that means it is infinite.There Shouldnt be a Difference.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Thanks.
How come it works when I call it from a Windows Form Application?
|
|
|
|