|
How do I get a list of all of the tables in a MySql database?
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
Have you read this?
Personally, I'm not a fan of ODBC and prefer ADO.NET.
I'm sure a search of Google would turn up other options.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hi,
Is there any way in SharpDevelop to not have XP visual styles enabled?
Regardless of wether or not i use Application.EnableVisualStyles(), the textboxes and comboboxes in the program i am working on still have the xp look.
Thanks
|
|
|
|
|
Pumk1nh3ad wrote: SharpDevelop
Which version are you using?
Paul
|
|
|
|
|
|
Pumk1nh3ad wrote: I am using version 1.1
Weird because I cannot get XP styles with 1.1, have you looked on SharpDevelop's forums?
Paul
|
|
|
|
|
Thanks. I will look on SharpDevelop forums.
|
|
|
|
|
Hope you find an answer there, those guys are pretty on top of things on that site. I just haven't used SharpDevelop much since working with VS2005, but nontheless, I still use it from time to time
PC
|
|
|
|
|
Maybe (just maybe) there's an App.manifest file that gives your app XP visual styles. Just an idea...
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Thank you!
There was an .manifest, and when i deleted it, the controls went back to the normal styles.
|
|
|
|
|
I'm glad I could help!!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Often I have functions, typically math, formatting, or database, where I'd like to use them in many different places in my application. What is good-form for instantiating and providing scope across many classes?
As a (semi)concrete example:
public class ContainerClass {
public T MuchUsedFunction( args ) {
// foo
}
}
public class A {
private ContainerClass cc = new ContainerClass();
public A_method() {
T result = cc.MuchUsedFunction( my_args );
}
}
public class B {
private ContainerClass cc = new ContainerClass();
public B_method() {
T result = cc.MuchUsedFunction( my_args );
}
}
So here classes A and B both instantiate a ContainerClass. I'd rather not do this.
Also, I'm not too keen on passing a handle to ContainerClass to A and B because, in a scaled-up version, I would eventually be passing many such handles. Finally, I appreciate that I may not want 'global' scope for ContainerClass and would like to know how I can control its scope.
What's the best way to handle this?
Thanks.
|
|
|
|
|
You basicly have two options.
One is to make a singelton class (do a search on CP for tutorials) or use static methods.
In the later case you can call a method like this: ClassName.MethodName()
Of course the second has it's limitations, as you can't use non-static methods of that class...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
A singleton makes 1 instance of the class -- but how do I provide scope to its methods to other classes? I don't see how a singleton solves the pb.
|
|
|
|
|
class Base
{
protected ContainerClass cc = new ContainerClass();
}
class A : Base {}
class B : Base {}
|
|
|
|
|
Is this the best way? Say A hits a database and B does a calculation. My MuchUsedFunction()might convert string formats. When I inherit I typically think of inheriting related properties. But converting a string format is not heuristically related to accessing a dB or doing a calculation. So isn't there a way to reflect this relationship better?
|
|
|
|
|
What i do with frequently used functions is make a class and use static functions, so it wouldnt require an object reference to use them, for instance:
<br />
public class utilility<br />
{<br />
static void MuchUsedFunct1() { }<br />
static double MuchUsedFunct2() { }<br />
}<br />
Then you could access these functions from anywhere in the program.
|
|
|
|
|
Hi, would you pls elaborate a bit. Where do you instantiate utility (utilility is quite creative!) and how do you use it in another class's method?
|
|
|
|
|
You can name it whatever you want, i usually use "utility".
With static methods, you dont need an object reference to call them, so if you have a class with static methods, for instance
<br />
public class test<br />
{<br />
private static string helloworld = "Hello World!";<br />
public static void HelloWorld()<br />
{<br />
MessageBox.Show(helloworld);<br />
}<br />
}<br />
you could call that method from anywhere in the program, like this:
test.HelloWorld();
Since static methods require no object reference, you call them using the class name, instead of a variable name. Also, when using static methods, anything else in the class that they use also has to be static.
Classes with static methods are kind of like modules in VB.net
Hope this helps.
|
|
|
|
|
This helps very much. Does 'protected' rather than 'public' provide scope for static methods as it does for non-static methods?
|
|
|
|
|
nyc_user wrote: This helps very much.
Glad to help.
nyc_user wrote: Does 'protected' rather than 'public' provide scope for static methods as it does for non-static methods?
Yes. For instance:
protected static string teststring = "A String";
|
|
|
|
|
Again, thank you for your help today.
-nyc_user
|
|
|
|
|
Have you tried declaring the function you want to be able to use everywhere
as a public static.
i.e.
public static void doThisEveryWhere()
{
...
}
You can now call this function from any of your other classes.
I usually have a common functions class called common.cs and I define all my common functions in it. And as it is static you don't have to create a common object to reference the function.
You would just type:
common.doThisEveryWhere();
Hope this helps.
|
|
|
|
|
hi guys,
i have a client/server application and i need to create installers for both the applications. i have a database (MSSQL2000) connected in my serverApp, how can i create an installer that includes the hostname of the PC(Server) that it is being installed.
|
|
|
|
|
Hi ,
my application is 1 EXE file only. and i want the user to run it.
if the user do not have Framework i want the installation to get it from the internet.
but again i dont want it to be web based.. just 1 file (windows installer/CAB..whatever.. EXE too) that the user run and it will download framework if needed and then run my EXE (my program).
again,no installation is needed (except from framework).
Thnaks,
Ran.
R.Z
|
|
|
|