|
True enough. You didn't mention anything about the databases you were using. From the evidence you provided it seemed only SQL Server.
You might want to look at the Microsoft Enterprise Library and the Data Application block to assist in writing a more generic data access layer.
|
|
|
|
|
Thanks for the link. I need all the help i can get with this two DBS thing.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
|
Parameters in ODBC don't have names. Use "?" in the query to identify the parameters, and add the parameters to the parameter collection in the same order as they appear in the query.
---
b { font-weight: normal; }
|
|
|
|
|
Cool Thanks for the help. I Guess I'm going to just to Replace() on the input string then. The attraction of using parameters was that it allowed a bit of latitude in how the sql strings where made.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
HahnTech wrote: I Guess I'm going to just to Replace() on the input string then.
Why? Just use '?'
Select System_id From [DFIParmsHTS].[docsadm].[ExtGroup] where CustNumber = ?
then
cmdSelect.Parameters.Add("", vfx.TNM);
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Yeah that would work Great if I was always only going to use one where clause or if this was the only sql statement in the program. But tomorrow or a week from now, myself or some one else will have to edit the sql to return a smaller range and forget that its ordinal specific then spend 2h trying to figure out why its not working. Replace() is ordinal unspecific and works all the time. I envy all you programmers that get to use a static DB schema.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
Stored Procedures
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Too many sites to manage and a moving Db schema make them too hard to manage.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
If you are not going to use parameters, be sure to encode the values properly when you put the query together, or your application will be wide open for SQL injections.
---
b { font-weight: normal; }
|
|
|
|
|
I am using SendMessage from the Win32 API to send keystrokes to the foreground window. The keystrokes do not arrive, though, somehow. I have checked, and the handle to the window that I get is correct. When I use SendMessage to send a character to the application itself it works, but not to another window.
I use the following API functions:
<br />
[DllImport("user32.dll")]<br />
public static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);<br />
<br />
[DllImport("user32.dll")]<br />
public static extern IntPtr GetForegroundWindow();<br />
And the following to send the message:
<br />
char a = new char();<br />
a = 'A';<br />
this.WindowState = FormWindowState.Minimized;<br />
IntPtr handle = GetForegroundWindow();<br />
SendMessage(handle, (int)Win32API.Messages.Char, (IntPtr)a, (IntPtr)0);<br />
The char enum is set to 0x0102, which is equivalent to WM_CHAR.
Does anyone know what I'm doing wrong? I would appreciate some help!
Thanks!
|
|
|
|
|
Is the window within your application space? Security will prevent you from sending keystrokes to a window that is not within your application space unless you have a remoting solution that specifically marshals the request between each boundary.
|
|
|
|
|
You could try sending the additional messages that get generated when you press a key, as well (WM_KEYDOWN, WM_KEYUP)...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Without Using Visible how can you hide a user control?
|
|
|
|
|
Move it offscreen or set its size to (0,0).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Moving the control offscreen? How is this done?
|
|
|
|
|
|
Set a location (x, y) beyond the screen. Lets say, if your screen is 1280x1024, set (x, y) to (1600, 0).
Best,
Jun
|
|
|
|
|
But check the Screens property as well, you may be moving it onto the second monitor.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Can anyone tell me how exactly does this "this.Left" method work in conjunction with a form or user control?
|
|
|
|
|
It returns the x coordinate of the control's left edge.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
Seems pretty straight forward to me
|
|
|
|
|
Mark Nischalke wrote: Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
Textbook answer.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
When all else fails, RTFM
|
|
|
|