|
Try this
>> Use connection strings in code for connections
>> Store the connection details in an XML file in the application directory, Fetch details from this file during connection.
>> You have to only change the XML File to change the database name
"I firmly believe that
any man's finest hour,
the greatest fulfillment of all that holds dear,
is that moment,
when he has worked his heart out in a good cause
and lies exhausted in the field of battle - victorious..."
|
|
|
|
|
Greetings:
I'm not sure if this is the proper forum for this question but I'll ask anyway:
I have downloaded the demonstration version of Dundas Charts and have been playing with them for a week or so. I like what I see so far and am considering purchasing a license. I am wondering about tech support however. Has anybody used Dundas Charts and, more specifically, has anybody encountered a problem that required tech support? How did that go? How quick were they to respond? How helpful were they? How many layers of know-nothings did you have to peel through before you got to correspond with somebody that could help you? What was the average number of hours / days from the time that you initiated contact to the time when the problem was resolved?
Thanks in advance,
Mark
|
|
|
|
|
I tested the charts, and I contacted support, I didn't tell them I worked for CP, because I didn't have to, the support seemed excellent.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to get the name and value of the control belonging to window in some other program?
Currently I am trying it with Win32 APIs. Here are the steps I am foloowing.
1) I am using 'FindWindow' function to retrieve the Handle for the target window.
2) Then I am using 'EnumChildWindows' to get the controls in the traget window.
3) Then I am using 'WM_GETTEXT' in 'SendMessage' function to get the value for the control.
But I also need name of the control so that I can Identify what control has what value. What function can be used to get the name of the control? How to achieve this using Win32 APIs?
Thanks.
Niranjan
|
|
|
|
|
There are no names in the sense you're thinking of. You'd be looking for the class name of the window you want to get. GetClassName[^]
As for value, not every control responds to WM_GETTEXT and there is no Value property that you can get either. If WM_GETTEXT doesn't work, you'd have to investigate other possibilities, like doing some serious debugging of the target app and digging around to get at the location where the control stores its data and try and grab it by directly reading memory. No, I don't have any example code.
Basically, there is no one method that is going to work for every control. What you want to do is problematic and not very reliable.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave for your reply!
Well GeClassname only gives name of the class like "Edit" for text boxes. So in that case we can not figure-out what text box had what value. e.g. Text1 was having value 'abc' and Text2 was having value 'xyz' etc.
Can we use something other than Win32 APIs in this situation?
Thanks for your help.
Niranjan
|
|
|
|
|
The only other identifier is the control's ID. The problem with that is that it changes from run to run.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to make my form NEVER_Minimizable
to do that.....i;ve done this:--
Protected Overloads Overrides Sub WndProc(ByRef msg As Message)
If msg.Msg = WM_SYSCOMMAND Then
If msg.WParam.ToInt32 = SC_MINIMIZE Then
Else
MyBase.WndProc(msg)
End If
BUT, This never handles Windows + D (Show Desktop) keys..
How to handle that ??
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Hello all!
I've been a user here at TheCodeProject for a long time but have never submitted anything. I think its time for me finally to give back. I recently have been working on a tutorial for adding software/serial key registration protection to .net programs. I was wondering if you as members of the community would find this useful? If not, what other topics would you be interested in having an article written about? Thanks for your time and responses.
|
|
|
|
|
Hi,
I have been trying to ctach an click event on a ListView when the cursor is not present on any items. I tried the Click and MouseClick events but I seem to do something wrong and the event does not fire off.
What I have been trying to do is to create a ListView which has rows added to it at run time based on the context menu. The context menu Has to get enabled or disabled based on some external condition. what I have done is I have put this code to enable or disable the menu in the click event. but I observed that I was not getting the event if there are no rows present in the list view and the event seems to work when there are some rows and the click is performed on the row. can anyone let me know what I am doing wrong.
Regards,
Vijay
|
|
|
|
|
Frndz,
In my ASP.NET 2.0 app I have a text box (used for entering amont). I do not want user pasting any text (Ctrl + V) on that text box.
So how do we avoid user pasting any text on text box?
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
You could Javascript it. So on Keyup you catch for Cntl-V. Or you could catch OnChange and then compare what is in the Clipboard with the value of the text box. If its the same, then clear it out.
|
|
|
|
|
There really is no good way to do what you are asking for. Perhaps if you tell the reason for why pasting would be prohibited, it might be easier to give an answer.
---
b { font-weight: normal; }
|
|
|
|
|
Since that asp text box control is for entering Quantity (which will be only numeric). I had alos written a JavaScript function on keypress of that .net textbox control to avoid any charecter other that numbers.
So by chance if user pastes the text & clicks Save button it gives type casting error(which is quite obvious).
So instead of checking on codebehind I wanna do it before saving.
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
Check the value using the onsubmit event, then. Here is an example:
http://www.guffa.com/Programming_archive.asp?id=28
You still should validate the data the server side, though. You can never really trust that the posted data actually comes from your page, or that the Javascript validation always works.
---
b { font-weight: normal; }
|
|
|
|
|
The following logic has solved my problem
<input onPaste="return false;">
Thanking you for your prompt and useful reply
Regards,
Vipul Mehta
Sr. Software Engineer
NIIT Technologies Ltd
|
|
|
|
|
That is an event that only exists in Internet Explorer. Any other browser will ignore it.
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to get the VSS bindings for projects in a solution from the EnvDTE object. There is a SourceControlBindings object but I can't find any documentation on it. I can get the Bindings by cracking open the INI files for Non-Web Projects but not for Web Projects. There must be a better way! Any help?
|
|
|
|
|
I have a ComboBox which binds to a volatile collection.
When the collection is changed, the ComboBox (drop-down) list isn't refreshed if it has already been dropped down by the user.
If the user does not drop-down the list before the collection change, then it does a fresh read on the source and gets the correct data.
I'm wondering if there is a notification event that I need to raise other than the standard PropertyChanged to force the ComboBox to refresh. Note: The collection object has no access or awareness of the control (as it should be) so it can't be done manually.
Thanks
NIK
-- modified at 14:04 Friday 22nd September, 2006
|
|
|
|
|
I'm just starting to use Managed C++ and .NET. I'm still in the early learning stages.
Basically, I have a Window Form that has a value for MyClass to use. I thought I could use the following code to pass the Form1 handle to the Myclass constructor.
I forward declare the Form1 class in "MyClass.h". In the constructor definition I pass the Form1 handle to a local variable just to see if the handle gets to the construtor. When the 'myTestVar = ' line is commented out, the program compiles and when I run the debugger I can see the Form1 handle being passed to the constructor and hTest being set equal to hForm. So I know at this point, I can pass the Form1 handle to the constructor.
When I remove the comments from the 'myTestVar = ' line, I get compiler errors. I can't figure out what's wrong.
1>.\MyClass.cpp(12) : error C2027: use of undefined type MyProject::Form1'
1> c:\visual studio 2005\projects\praxflow\praxflow\MyClass.h(4) : see
declaration of 'MyProject::Form1'
Currently, I have a private member method within the Form1 class called setMyClass( ^Form1 ) which works but this doesn't seem very OOP to me.
//----MyClass.h----
#pragma once
namespace MyProject
{
ref class Form1; //forward declaration
}
public ref class CMyClass
{
public:
CMyClass( MyProgram::Form1 ^hForm );
private:
int myTestVar;
}
//----MyClass.cpp----
#pragma once
#include "StdAfx.h"
#include "MyClass.h"
CMyClass::CMyClass( hForm )
{
MyProject::Form1 ^hTest;
hTest = hForm;
// myTestVar = Convert::ToInt32( hForm->txtFieldFromForm1->Text );
}
//----Form1.h----
#pragma once
#include "MyClass.h"
namespace MyProject
{
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
//--- initializing stuff
}
protected:
//---destructor
private:
private: System::Void btnInitMyClass_Click(System::Object^ sender, System::EventArgs^ e)
{
CMyClass MyClass = gcnew CMyClass( this ); //Instantiate and initialize using the Form1 handle.
}
};
}
|
|
|
|
|
hi there
I'm a beginner into vc .net, and a have installed vs . net 2003 vc++....
Now I'm trying to find a crystal report tutorial or a sample code, but all I find is in C# or VB, i a wish to learn to do such kind of things in VC++...
how to search (find) samples in VC++ on msdn web site or here..etc
pls pls pls
alexa2g@yahoo.com
-- modified at 12:14 Friday 22nd September, 2006
|
|
|
|
|
If you have a specific question you would do better posting it in the VC++ forum. Code Project has a search articles capability.
|
|
|
|
|
|
What is the Top code in Dot. NET?
Hai this is Prabahar, working as a Software Engineer, in .NET Plateform for more than 3 years.
|
|
|
|
|
That's not a real question. Do you mean the best code, the best language, what ? I can't imagine a way to interpret it that gives it a cut and dried answer.
If someone asked me that in an interview, I'd say 'the code I'm going to write for you when you hire me'.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|