|
I have a datacolumn that is defined as decimal in a stored procedure with 28 digits (4 of them for decimals), is there a way I can get the 28 back from this as the length in any property or any other way ?
I need this dynamically, as I don't want to hardcode 28 in case the size increases/decreases.
I noticed on nvarchar fields the maxlength is set, but on decimal, datetime and int fields these are always -1.
Thanks
|
|
|
|
|
Either stop thinking of numbers as a sequence of digits or convert them to VARCHAR.
|
|
|
|
|
I don't think there is a convert to VarChar in C#.
|
|
|
|
|
I have crated a table called employee. My form contains a textbox with label 'fname' and a button (find). I have created a datset and datagridview.
When my forn load I can see all the data(of the empolyee table)in the datagridview. When a user enter text in textbox and presses 'find' button the datagridview must get refreshed and show rows where employee.firstname matches textbox.text
How do I pass textbox.text value to the sql querybuilder(like select * from where clause employee.firstname = ?????) which can be used by dataadapter.fill method
Waiting for response
Thank you
|
|
|
|
|
Look at database articles on CodeProject that discuss using SqlCommand object.
led mike
|
|
|
|
|
I have an application that runs in the background and pops up windows with reminders, thing is I don't want it to pop up the windows if I play a full screen game. How can I detect if a full screen application is running?
|
|
|
|
|
Don't, but take a look at Form.Activate
|
|
|
|
|
If you really want this (and I can understand some popups are annoying in the middle of
a game), you could use PInvoke to get at EnumWindows, and check if there is any main window
with a size equal to the screen size.
It may be insufficient for exact size match (e.g. a maximized window is larger than the screen,
just check it), and having multiple monitors might also complicate matters.
Two prototypes to get you started:
/// <summary>
/// Enumerate all windows, calling a delegate for each of them.
/// </summary>
/// <param name="ewp"></param>
/// <param name="lParam"></param>
/// <returns></returns>
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)]
public static extern int EnumWindows(LP_EnumWindowsProc ewp, object lParam);
/// <summary>
/// delegate used for EnumWindows() callback function
/// </summary>
public delegate bool LP_EnumWindowsProc(IntPtr hWnd, int lParam);
Luc Pattyn
|
|
|
|
|
How do I tell Visual Studio C# 2005 about a DLL supplied with my USB hardware (motor control - MotorBee). I need to be able to call the functions in the DLL. Is it so trivial that its obvious? (not to me!)
sysrev
|
|
|
|
|
See a previous message[^]
Plus:
chances are your USB dll is not a .NET dll but rather a native code dll.
In that case you dont need references and using, but you need PInvoke, i.e. the
techniques required to call native code.
Lots of examples are available on CodeProject. Prerequisite is some documentation
as to what functions are available in your USB dll.
Luc Pattyn
|
|
|
|
|
Thanks for pointing me in the right direction - I will investigate.
Is it only me or does anyone else find the Visual Studio help system difficult to get meaningfull answers from?
Ted Edwards
Ted Edwards
|
|
|
|
|
Well I am satisfied with Help/Index... which leads to the reference info,
although I often feel I would like each item to have an example;
and I am not impressed much by Help/Search... , IMHO it needs a better search engine.
A useful feature is Help/SyncContents: when in one of the reference pages, it leads
you to the matching location in the Content pane, so you can easily browse
neighbour information.
Luc Pattyn
|
|
|
|
|
It is mostly the search I have trouble with. The problem is really me in that I should learn C# and Visual Studio properly. I never seem to have time, always pressure to make something work "quick and dirty".
Ted
Ted Edwards
|
|
|
|
|
Hello
How can I handle .shp & .shx & .dbf files
in C#
THANKS for HELP
|
|
|
|
|
Hello
In vb6 function like
picturebox1.scale(20,50)-(128-208)
used to scale picturebox control or form
first point is the start position(topleft) and second point is the end position(bottom right)
I want to get the same in C#
THANKS for HELP
|
|
|
|
|
You can position and size your picturebox any way you want.
You can assign an image to the PB, and finally there is PictureBox.SizeModethat defines
what to do when picturebox and image happen to have different sizes.
When in doubt about some class, first thing to do is read the page(s) in MSDN, the help
information that is built in Visual Studio. (Menu Help/Index... or Help/Search...).
Luc Pattyn
|
|
|
|
|
how to create multiple instance of a windows service in the same server.I have to run 5 instance of a single windows service in the same server .Environment is .Net and c#
people laugh at me because they say im different and I laugh at them because they are all the same.
|
|
|
|
|
I am not sure this is possible.
Cant you organize a single service in such a way that it can serve multiple clients at once ?
Can you explain a bit what functionality you want to achieve ? This is likely to yield more
and better answers...
Luc Pattyn
|
|
|
|
|
Right. Other than that they each need a unique name. It can be done, but there is likely a better way.
|
|
|
|
|
i got the answer.The situation is like we have to monitor multiple server from the single service for perfomance reasons we are using a single service .
people laugh at me because they say im different and I laugh at them because they are all the same.
|
|
|
|
|
I need to create, to edit, to eliminate contacts of outlook with the servant exchange server 2003 from an application web (c *.net with framework 1.1).
Since I can do this?
.net
|
|
|
|
|
Outlook and Exchange Server are not the same thing. They each have there own programmatic interface. Perhaps you should read some Microsoft documentation on each of them.
led mike
|
|
|
|
|
Hi,
I have a C# class which has a number of properties. I want to create a collection for this class to pass to a method. Can anyone tell me how to do this? There must be a standard way I think.
|
|
|
|
|
Take a look at Generics in .NET 2.0. List<ClassName> or Dictionary<key, ClassName> are probably what you need.
|
|
|
|
|
What is the collection supposed to hold: multiple instances of that class ? the public properties ? or something completely different ?
Luc Pattyn
|
|
|
|