|
The '@' character might be causing you problems:
From the SQL Server Books Online:
SELECT @local_variable
Specifies that the given local variable (created using DECLARE @local_variable) should be set to the specified expression.
It is recommended that SET @local_variable be used for variable assignment rather than SELECT @local_variable. For more information, see SET @local_variable.
Syntax
SELECT { @local_variable = expression } [ ,...n ]
Arguments
@local_variable
Is a declared variable for which a value is to be assigned.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
Would this also apply to a XML data file?
Best,
Jerry
Contrary to the cliche, genuinely nice guys most often finish first or very near it.--Malcolm Forbes Toasty0.com
|
|
|
|
|
Toasty0 wrote:
Would this also apply to a XML data file?
Oops. Somewhere I got the idea that this was an SQL statement.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
Hi,
My application contains a Panel which in turn contains some more panels, that are added and removed at runtime. I draw some lines and strings also at runtime. Usually there will be many controls that do not fit into the visible area of the parent panel. So, I would like to implement zoom in and zoom out in that panel ( as we do in Flash pages ).
To best of my knowledge, normally zooming is implemented on images. How to implement on objects like panels ??
Thanks.
Cheers
CNU
|
|
|
|
|
AFAIK, the hard way--you have to do code all the functionality. There's no built in API stuff to do that.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
I am not going to try to take credit here, and will just link to the article.
I thought it was funny how the Standard Edition would not let me make a windows controls library project, but it is fully possible in SharpDevelop using just the SDK compiler.
I did some googling, and this article came up.
http://www.devcity.net/net/article.aspx?alias=vbnet_se_dll
A great find, and I can finally make Dll user control libraries in the standard edition as well.
PS! although the article is for VB, I have testet it with C# myself, and it works great.
Enjoy!
HalfAsleep
|
|
|
|
|
You can make a Windows control library - there's just to project for it (a template of files and settings). Just start a regular class library and add a class that derives from a control. There's no difference other than the base classes from which your classes derive.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Ah, nice to get that confirmed. I was a bit miffed that the standard version did not have that project template.
If a normal class library template will do, and everything will work as long as you have classes that inherit from controls, that is good news indeed.
Thanks a bunch!!!
By the way, is there any way of adding your own project templates in the "new project" dialogue?
HalfAsleep
|
|
|
|
|
Explore your Visual C# installation directory. The default is C:\Program Files\Microsoft Visual Studio .NET 2003\VC#. There's several directories involved and it's really not too difficult to figure out, but I believe you might find some articles here on CodeProject and elsewhere on the 'net if you try a search.
There is one tutorial in the Visual Studio .NET Product Documentation, but it's targetted at the Enterprise Architect edition which include a project for making projects (it's fairly close to what you need, though).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Anyone know anything about reading the game port in C# ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Man, Chris, you write so much interop code and unsafe code (remembering your previous articles about graphic manipulation), you should just use C/C++, or at least switch to MC++!
Have you looked into Managed DirectX at all at http://msdn.microsoft.com/directx[^]. Much of this is encapsulated in a nice object-oriented fashion (and the Managed DirectX libraries are written from the ground-up, not simply interop libraries or 1-to-1 mappings of managed code like some libraries).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath Stewart wrote:
or at least switch to MC++!
*grin* I hate the idea of MC++, as far as I am concerned, it's useful only for porting code to .NET. Otherwise, I may as well use the language that was written for .NET. Plus, C# is actually full of some really cool stuff.
Heath Stewart wrote:
Have you looked into Managed DirectX at all at http://msdn.microsoft.com/directx[^]. Much of this is encapsulated in a nice object-oriented fashion (and the Managed DirectX libraries are written from the ground-up, not simply interop libraries or 1-to-1 mappings of managed code like some libraries).
Yes, I am using it. The AudioVideoPlayback namespace is an utter disaster. It occured to me after posting though that it would probably be the way to go for the joystick, DirectInput and all. I just need to make sure we wire our device the same as a joystick, so I get the right messages
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
If you don't want to use DirectX you could also interop the joy* Win32 functions.
There are just a few and they're really easy to use. Basically you call joySetCapture and then start receiving MM_JOY1MOVE , MM_JOY1BUTTONDOWN and the other joystick messages in your overridden WndProc .
The only disadvantage is that WindowsXP messed up the joySetCapture /joyReleaseCapture functions. Trying to open a Joystick a second time in your application (after releasing it first, of course) fails with some obscure error, but only with WindowsXP.
Hope this helped,
mav
|
|
|
|
|
Couple of questions about ListView:
Is there a way to make column headers invisible?
Is there a way to increase the padding between rows?
I have long text inside of some cells. How do I make the text wrap around and the cell height grow to make all the text visible? (instead of having the text all in one line and having to resize the column to read all of it.)
Thanks,
Elena
|
|
|
|
|
The first is simple: set ListView.HeaderStyle to ColumnHeaderStyle.None .
For the latter, I urge you to search CodeProject for "ListView" or something simple and browse the results. There have been several articles detailing this. It's not an easy thing to handle, since you have to go back to handling windows messages, declaring structs, and interoperating with unmanaged code using P/Invoke for functions like SendMessage .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Is there any way to access and delete cookies obtained by the Microsoft Web Browser Control?
|
|
|
|
|
You need to P/Invoke InternetGetCookie :
[DllImport("wininet.dll", CharSet=CharSet.Auto, SetLastError=true)]
static extern bool InternetGetCookie(string url, string name, [Out] string data,
ref int size); Do not declare the third param using out , be sure to use the OutAttribute as I've done above. A String (C# alias string ) is already a reference type, so you're already passing the address of a string variable. Double referencing will crash the CLR.
To call it, consider a wrapper method since P/Invoke methods should not generally be exposed as public members (depending on if you're writing a library or just using this in an app):
public string GetCookie(string url, string name)
{
int size = 0;
string data = null;
if (!InternetGetCookie(url, name, null, ref size))
{
if (Marshal.GetLastWin32Error() == 122)
{
data = new string('\0', size);
if (InternetGetCookie(url, name, data, ref size))
return data.Trim();
}
}
return null;
} You'll still need to parse the cookie string, though, but that should be simple.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Once I got the cookie, do you know what I would have to do to delete it? Also, let's say I wanted to return all cookies for a specific website. I understand I pass in the homepage of the website as "url", but what do I pass in for "name"? Thank you
|
|
|
|
|
I recommend you read about the WinInet Functions[^] on MSDN Online.
If you want to know more about InternetGetCookie , you should read[^] about it on MSDN Online as well, which is under the WinInet Functions that I posted a link to above.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
hi you all
im working on a paint project and i need some help with the rectangle select tool. id appreciate all the help i can get...
|
|
|
|
|
What help do you need ? I've got a paint program here on CP called Doodle which may have the tool you're looking for. I can't remember, but I suspect it's in C++. It would be dead easy to port tho.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi chtristian, thanx for replying .yes id really appreciate it if you send me the doodle program . thanx again
|
|
|
|
|
To reiterate - I have an article here on code project which creates a simple paint program called doodle, you should read the article and download the code, it will probably help you.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
First let me thank you guys, for sharing your knowledge and for responding.
I am a newbie learning .NET, so plz bear with me. my question is, how to bind a CheckedListBox control in a WinForm. I did the binding, but it is not showing any values, it's not giving any error either, I wanted the CheckedListBox control to be populated at the FormLoad Event.
my code is given below. I tried different ways, but still its not working.
lstFacilityType is a CheckedListBox control.
First, I tried this.
-------------------------------------------------------------------------
lstFacilityType.DataBindings.Add(new Binding("Text",ds,"FacilityType"));
-------------------------------------------------------------------------
Second, I tried the code given below, it is returning the table in the dataset.
------------------------------------------------------------------------
lstFacilityType.DataBindings.Add(new Binding("Text",ds.Tables[0],"FacilityType"));
------------------------------------------------------------------------
Thanks, for ur help.
abhi
|
|
|
|
|
If you're trying to bind the actual list, you need to need to fill the Items property manually. Binding the Text only binds the Text property.
You should read about the DataBindings property and the BindingManagerBase class in the .NET Framework SDK.
The code you're doing above needs to bind to the Text property of the control for which the Binding is added (i.e., lstFacilityType ). The rest of your expressions won't work, however, because the Binding only works for PropertyManager , not to bind to an IListSource or IList , of which DataSet and DataTable are (respectively). When you bind to a data-bound control like a DataGrid , it nows how to use the DataSource and, optionally, the DataMember to enumerate the collection and bind a UI element to that row. Binding how you're doing it is not the same. The results you're getting are to be expected since you're binding against an object, not its value.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|