|
Through VS 2003 (.NET 1.1) we are generating an XML file, the owner of the file is always Computer Name. But we want the windows user, creating the file to be the owner.
We have achieved this change in ownership through VS 2005 (.NET 2.0), but are unable to do so in VS 2003 (.NET 1.1). If anybody has any knowledge on this do share it with us.
Destination folder in which the file has to be created is in shared path on another server.
Any help in this regard will be highly appreciated.
Thanks in advance!
|
|
|
|
|
Hello all...
Can any one please tell me how can we add .rpt and .cri extensions in IIS (windows 2000 with crystal reports 9 installed on the same). For crystal report 8 we need to map these extensions to "C:\Program Files\Seagate Software\WCS\Wcsinsapi.dll" but this is not the case with CR 9, so i am wondering if anybody knows how will it work for crystal report 9(CR 9).
Any suggestion will be helpful... i really got while trying it from 1 whole day... please help me friends...
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
Hi all,
I've been laboriously opening and closing SqlConnections, SqlCommands and SqlDataReaders etc. until I recently found out about the nice using approach to all of that.
using (SqlConnection mySqlConnection = new SqlConnection(...))
{
mySqlConnection.Open();
using (SqlCommand mySqlCommand = new SqlCommand(...))
{
using (SqlDataReader mySqlDataReader = mySqlCommand.Execute())
{
...
}
}
}
One thing that I am unsure about though has to do with the scope of a SqlConnection if used this way.
Let's say for instance that I have two functions that perform an action against the database, myFunc1() and myFunc2() . Inside each of these functions the SqlCommand and SqlDataReader is implemented. If a connection is established as described above, it will not have scope inside such a function:
using (SqlConnection mySqlConnection = new SqlConnection(...))
{
myFunc1();
myFunc2();
}
On the other hand I don't want to open the SqlConnection first in each function. I've heard talk of "connection pooling" so it might not be a problem to do so but I don't know about that. If anyone would care to explain conection pooling I'd appreciate.
But basically, my question is. Is there an elegant way of making the SqlConnection available to other functions that will be called from inside the using block or would it be better to have a good old instantiation of a SqlConnection class at the top, open it manually and then close it manually again?
I suppose one solution would be to pass the SqlConnection as a parameter to the function that will be working on it but for some reason I don't like that.
I'm sure there's an industry-wide accepted norm for doing this type of thing. Throughout the application there are references to the database but you don't want to open and close the DB connection every time.
|
|
|
|
|
Dewald wrote: I suppose one solution would be to pass the SqlConnection as a parameter to the function that will be working on it but for some reason I don't like that.
Why ? That is the easy method. You can do it like
using (SqlConnection mySqlConnection = new SqlConnection(...))
{
myFunc1(ref mySqlConnection );
myFunc2(ref mySqlConnection );
}
If you don't want to pass the connection, try the following.
private SqlConnection mySqlConnection = null;
using (mySqlConnection = new SqlConnection(...))
{
myFunc1();
myFunc2();
} In this mySqlConnection is declared as private in the class. So you will get access to all methods.
When I have created a DAL, I implemented IDisposable interface and provided a Dispose() method which clears my SQLConnection instance. It will be instantiated in the constructor. So it would look like
public class MyDAL : IDisposable
{
SQLConnection mySqlConnection = null;
public MyDAL()
{
mySqlConnection = new SqlConnection(...);
}
public void Dispose()
{
}
}
You can call this like
using(MyDAL dal = new MyDAL())
{
} In the above code, you haven't passed any parameters to the methods.
Hope it helps
|
|
|
|
|
Hi,
I need to copy some Content in Excel Sheet and send that Matter as a Mail Content in body of that Message not as attachment.
I used Excel .dll i.e Microsoft Excel 11.0
Is there any way to do this.
Thanks in advance.
|
|
|
|
|
Look into the methods that come with the Office Interop Library.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
how can i access the xml file in the in richtextbox in c#.net?
|
|
|
|
|
Do you want to display XML file contents to a rich text box ?
|
|
|
|
|
how to make multiline at statusbar at c#
|
|
|
|
|
I assume you mean the StatusStrip control? If so, alter the LayoutStyle property to Flow.
|
|
|
|
|
thanks for the reply and valuable solution...
now one more question.. i have two lines.. second one is only a word.. and i want that in center of the first line.. how to make that..
please reply
|
|
|
|
|
Use VerticalStackWithOverflow in the same property. It will stack every item, 1 to a line, vetically. If that's not what you need, you're gonna have to create your own control.
|
|
|
|
|
|
hi,
I'm looking for a tool that i can run to check a XML file on my sever and read the version numbers than are currently installed then if they are new to download them and install preferably by a silent install or for it to download 2 files and i will make a batch file to silently install i need it to update many applications while also checking for newly added applications also i what to run it in at the start up of my computer
PS. I'm not sure if C# is the right language but its my prefered language i can also us C++ i also tried this one http://geekswithblogs.net/arosenfeld/articles/43620.aspx[^]"> but it didn't quite work like how i what it to
thanks all
|
|
|
|
|
|
|
if i am accessing a xml file in c#, tree view. an if i delet the node from tree view an save it in original xml file, how can i save it? plzzzzzzz help me its urgunt.........
|
|
|
|
|
AFAIK, you need to handle the event which fires when a node is deleted, then find the same node in the XML file and delete it. Then save the file. You can use XMLDocument class for this.
|
|
|
|
|
Hello!
I was wondering if it is possible to monitor all the URLs visited from a Internet Explorer. Searched little bit, but wasn't able to find anything useful.
For further clarification, I want to keep the log of each and every URL visited/browsed/accessed from Internet Explorer, including all the links of files downloaded (even from save as dialog box).
Anyone have any idea where to start?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Adeel Chaudhry wrote: any idea where to start?
Not sure. You might have to tap into the object instance of the url textbox. I've seen it done for other apps, but don't recall the exact approach.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: You might have to tap into the object instance of the url textbox.
Do you mean instance of Internet Explorer's URL textbox?!
Paul Conrad wrote: I've seen it done for other apps...
Can you let me know the names of such applications?
Thanks for quick reply!
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Adeel Chaudhry wrote: Do you mean instance of Internet Explorer's URL textbox?!
Yes.
Adeel Chaudhry wrote: Can you let me know the names of such applications?
I know QA Wizard does. It is commercial, and you won't find the code. A google search can probably bring something up as far as sample code goes.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I think you need to get the handle to the window, then find the handle for the textbox from there. There should be articles on that sort of thing here on CP, though no doubt in c++.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Can you provide me a link for how to create four sided handles on an image in C#. Thanks
|
|
|
|
|
netJP12L wrote: provide me a link for how to create four sided handles
Try google.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|