|
hi all, somebody can help me to do this
how to search SQL Server in my LAN with C# ???
Thanks !!!
Nho'c Ti`
|
|
|
|
|
This is a very broad question. What exactly are you trying to do?
- query a SQL server?
- find all available SQL servers?
|
|
|
|
|
yes, I want find all SQL Server avariable in my LAN
Nho'c Ti`
|
|
|
|
|
You can use SQL-DMO for this: Application.ListAvailableSQLServers()
Alexandre Kojevnikov
MCAD charter member
Leuven, Belgium
|
|
|
|
|
|
I have built a .net control which works well in XP and Win 2000, but fails in NT 4.0 and throws an exception FileLoadException.
Why would it fail in NT and work well in Win2000 and XP?
In my code, where I am declaring P/Invoke functions, I have the following:
[DllImport("uxtheme.dll")]
static public extern int SetWindowTheme(IntPtr h, string s1, string s2);
But the thing is I do not call this unmanaged function in my entire control's source code.
Its just declared. That's all.
Do you think this could be causing the problem of FileLoadException when I try to run it in NT 4.0 (because there is no uxtheme.dll in NT 4.0).
Note that although I have declared it in my code, I never call this function at all.
Do you think I need to remove this declaration from my code and rebuild it to run it in NT 4.0 box.
|
|
|
|
|
Wow! I'm amazed you actually got it to work on windows 2000.
uxtheme is a feature for windows xp and newer only. its not possible for it to work on older version of windows
|
|
|
|
|
No need to be amazed at all!
I found the answer to my problem.
Anyway, for your information, it will work in Win 2000 without any problem because the uxtheme P/Invoke function was "just declared" in the code and "was never actually used" or "called" and hence there is no issue for it to be running properly in Win 2000.
|
|
|
|
|
Hi!
How do you detect the duration of the dial-up connection?
Please help me!
And one more question, is it possible to use C# to transfer files programmatically?
"To teach is to learn twice"
|
|
|
|
|
I'm trying to use the Regex class to evaluate data entered by the user. However, since I'm doing the evaluation as the user types, I'd like the match to be successful even if all the data has not been entered yet.
For example, if I have:
Regex re = Regex("abcd");
And the user enters:
ab
I want re.IsMatch("ab") to be successful. Yes I know it's not a true match, but it's only because there's insufficient data. Is there an easy way to know this?
Thanks in advance!
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
Hmm.
One way would be to use a pattern like:
Regex("a(b(c(d)?)?)?)");
Not too elegant, but it would work.
|
|
|
|
|
Alvaro
Any answer would of necessity be a specific workaround for a specific regex string. There is no way to generalize it, I'm afraid (apart from writing your own regex engine that allowed for partial matching).
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
I have this code to a DataGrid
dgDataGrid1.CurrentCell = new DataGridCell(0,0);
but it says I cant use it yet but if I move it to formLoad it will. And it is in formLoad event!
what gives?
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
This is just a wag, but maybe dgDataGrid1 hasn't been instantiated yet. Put a breakpoint on where you assign CurrentCell and another breakpoint on where dgDataGrid1 is constructed, and see which happens first.
Hope that helps.
Marc
STL, a liability factory - Anonymously A doable project is one that is small enough to be done quickly and big enough to be interesting - Ken Orr
Latest AAL Article
My blog
|
|
|
|
|
Without seeing your code it's hard to provide a specific answer, but here's some suggestions:
Ensure your DataGrid is instantiated in the Constructor.
If your DataGrid is already populated, set the CurrentCell to a reference of a cell that actually exists - your code sets it to a reference of a new cell.
If your DataGrid is not already populated, you may have to define columns/rows before being able to set a cell.
|
|
|
|
|
FormLoad()
{
dgDataGrid1.DataSource = myList;
dgDataGrid1.CreateTableDefition(); // creates my table styles and applies them
.. the current cell code ...
}
thats what it looks like. its instantiated, a data source has been set and a table style is created then a call to current cell
go figure
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I have a user control that needs to function like a panel in the designer. Is there an attribute to set to have it behave this way?
|
|
|
|
|
public class myControl : System.Windows.Forms.Panel
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Well Duh!
I have a custom control here and I need to do the same thing with it without deriving from Panel
|
|
|
|
|
AK wrote:
I have a custom control here and I need to do the same thing with it without deriving from Panel
So, what features of Panel are you talking about? A panel is basically just a container for another collection of controls. But that's a property of Control, not Panel. It provides grouping for radio buttons. But that should be easy enough to implement yourself. Similarly with Panel's enable/disable feature--disable the panel and it's child controls are disabled. The only other thing about panels is the AutoScroll capability, which again may or may not be necessary but is fairly easy to recreate.
And why not derive from Panel? If that doesn't work, then you can derive from Control but contain a panel, and pass through whatever functions you want to the Panel object and provide your own drawing.
Maybe my article will help too: http://www.codeproject.com/cs/miscctrl/csoutlookbar.asp[^]
Good luck!
Marc
STL, a liability factory - Anonymously A doable project is one that is small enough to be done quickly and big enough to be interesting - Ken Orr
Latest AAL Article
My blog
|
|
|
|
|
Sorry for not explaining this well enough.
What I was looking for is an attribute, or something simple to tell the VS.net designer to allow me to add child controls to my custom control. I don't need scrolling or anything extra. Just a way of treating my control as a control container.
Thanks for your help.
|
|
|
|
|
By the sounds of it, what you need to do is create a designer class for your control. Control designers are a complex subject, so I'd suggest looking up the MSDN doco, or look at some CP articles such as Jerry McGuire's designer for the Magic docking library for some insight.
|
|
|
|
|
This should be simple to answer, but MSDN comes up blank.
I've noticed some C# code with an @ in front of string literals:
MyNameIs(@"Alvaro");
What is it for?
Thanks in advance,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
the @ supresses escaped characters... for example:
a windows path of C:\Program Files\ would normally have to be defined like this:
string path = "C:\\Program Files\\";
because back slash is a character which must be escaped.
if you use @, then it ignores special characters:
string path= @"C:\Program Files\";
hope this helps.
|
|
|
|
|
It also lets you write multi-line string constants.
The feature name is "verbatim string".
|
|
|
|