|
Is there any way I can create the same file dependency that has an asp.net application but this time with a class library
What I'm trying to do is call from BizTalk the class library which has to locate a file that will parse, but it would be better if there wouldn't be the need of hard coding the path to the file that this class library will parse
And this parsing process will be repeated daily, so if the file to be parsed changes its location for some reason or the class library is moved to another computer, then I just have to change the configuration file instead of compiling again
With ASP.NET you can configure this with the web.config, with windows form or console apps with app.exe.config but can't find anything for class libraries
Thanks in advance
Isaac
|
|
|
|
|
Place (and name) your config files, as the would belong to the exe-file that uses your class library. A class library doesn't have an association to a config file of its own.
Example:
if your class library is in c:\x\my_class_library.dll and it is beeing used by c:\y\some_executable.exe, then your .net will on behalf of your class library look in c:\y\some_executable.exe.config
|
|
|
|
|
I would like to have a menu shortcut for Ctrl+Alt+F1 but don't find that combination in the Shortcut enum. Is there a way to create this shortcut string by ORing values or some other method that I have not found yet.
Thanks
Neil Lamka
neil@meetingworks.com
|
|
|
|
|
How can I set the Tab-Stops in a ListBox to have all Items that are seperated with '\t' aligned. In C++/MFC (CListBox) it was with SetTabStops() but now in C#/.NET ???
I fount the Property 'UseTabStops' to enable/disable the using of the TabStops, but Nothing to set the distance between the TabStops.
Greets
Roland
|
|
|
|
|
|
Thank you for your Help, it works ... but unfortunately it works only for the ListBox but not for the CheckedListBox
I thougth, because the CheckedListBox derives from the ListBox, it should be for both the same, but it looks like i was wrong.
For me this looks like Microsoft has done their job only the half way ...
Roland
|
|
|
|
|
Roland Bär wrote:
For me this looks like Microsoft has done their job only the half way ...
It is .NET 1.0 or 1.1, not .NET 6.0! Much better start on .NET than their first web browser
Rocky Moore <><
|
|
|
|
|
You're right, let's wait for .NET 3.0 (don't trust even numbers ).
I was only disapointed because it was the second time in my first .NET Project that I had to use a [DllImport...] Workaround to get functionality that was done in MFC (or even in VB I think) easy.
Roland
|
|
|
|
|
You know you can always build a class based on it and then override the painting to display the string as you wish. In .NET it is easy to extend classes! I have a entire set of controls (or most at least the ones I use all the time) wrapping the standard controls and then add in my own form style sheets to control the appearance and functionilty globally in the applications.
For an example, I can change color for read-only state, normal state, hover state. I am completely rebuilding a DatePicker control because I have not found one I like and have already rebuilt a checkbox that includes the text and checkbox within a box that has its background able to be set in any one of those three states.
In my current product, I wanted to keep all controls while browsing data in a read-only state and then when they hit a button to enable editing of the record, it will change the state and the appearanc of all the controls change without have those gray almost unreadable appearance of disabled controls.
All of this started when I got ticked because I could find no way to show the state of a tri-state checkbox when it was disabled.
Oh well, there I go rattling again. In short, it is easy to customize the output of controls so that you get the functionality you want.
Rocky Moore <><
|
|
|
|
|
Is there a way to declare a variable without specifying the type and specifying the type later?
I need to declare a connection object to the DB but Idont know if it is SqlClient or OleDbClient until later in the code..
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
You could declare it as on object type and then do some casting later on, when you do decide what it is.
Or you can look to find their nearest common base type (which will always be object at some point at the top of the tree).
Hope this helps, but I couldn't find those types in the MSDN documentation, though I did find the SQLClient namespace.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I thought of that as well,
<br />
private object objConnection;<br />
then you go
<br />
if (isSqlServer)<br />
objConnection = (SqlConnection)objConnection;<br />
else<br />
objConnection = (OleDbConnection)objConnection;<br />
<br />
objConnection.Open();<br />
But the compiler throws an error saing that the type object does not support he Open() method...
hmm...
Then I thought of having both Sql and OleDb connection objects in a Hashtable but again it wont work coz I have to cast them again into the right type in order to extract them from the Hashtable...
Hmmm...
Brain cells dont work well 2day...
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
I think you have to Cast it each time you call a member of the Object:
<br />
if (isSqlServer)<br />
((SqlConnection)objConnection).Open();<br />
else<br />
((OleDbConnection)objConnection).Open();<br />
<br />
Hope that helps...
Roland
|
|
|
|
|
I hand't thought of that....
Isn't that though too much overhead for the server?
I have no idea if casting is a heavy job or not...
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
|
use interfaces!
Good Luck
Alex Kucherenko
|
|
|
|
|
yeah I just came up with that IDbConnection inteface
or shall I just make an abstract class and then make a class for each DB Client?
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Only two question:
Is it realy needed to support Sql and OleDb clients at the same time?
You need both dataaccess methods in runtime?
I make my current project using only OleDb... And I can say that i have no performance looses. OleDb give you more kinds of storages that can be used by you.
So... if you still interesting in support of two data access methods then better write own short wrappers... later they can be easily grow to someting more complex.
Good Luck
Alex Kucherenko
|
|
|
|
|
I see your point,
but, as Microsoft claim, the SqlClient is suppose to be much faster than OleDb when using SQLServer. So I feel that it is important to use it...
Depends always on the application and what performance you are looking for I guess...
But once I getting into the mission to make an object to handle all DB interaction, (and I have the time to do it now) I rather do it now than having to come back in a few months and sort out then...;)
I think that I will make an abstract class and then have a class for each client... This way it is more expandable aswell...
I might share it in an article when I am done.;P ;P
Thank you all anyway for your help!!!...
I am sure that I will be back with more qestions soon...
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Nope.
Go for the interface...
|
|
|
|
|
I dont know how to use it
I will read MSDN...
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Like this:
<br />
private IDbConnection objConnection;<br />
objConnection will now take either a SqlConnection or a OleDbConnection object.
(objConnection = new SqlConnection(); or objConnection = new OleDbConnection(); will work equally well...)
The IDbConnection interface has the Open() and Close() methods, so you don't have to do casts to use them...
objConnection.Open();
|
|
|
|
|
this is looking good...
than you
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Hi,
I'm looking for a mean to use printer fonts in c# or vb.net
I've tried with drawing.text.installedFontCollection, but i doesn't find the printer fonts only system fonts
In VB6 there is a very simple function : Printer.Fonts()
How can i do this in .NET
can somebody help me?
thx
|
|
|
|
|
Are you sure printer fonts are not the same as system fonts in .Net?
Mazy
No sig. available now.
|
|
|
|