|
hi,
try using the keypress event of the datagridview.
as
private void DataGridView1_KeyPress(Object sender,KeyPressEventArgs e)
{
DataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
DataGridView1.CurrentCell = DataGridView1.Item(3,DataGridView1.CurrentCell.RowIndex);
}
hope this helps
Regards
Anuradha
|
|
|
|
|
How to bind the countries in html select control using javascript
Here ,I want to bind all the countries,states list in the html select controls separately depending on selection of perticular country for storing in database... using javascript or c#.
Thanks.
|
|
|
|
|
I think you want the ASP.NET forum. I'm sure there are controls that do this on this site and elsewhere. You need a list of countries and a list of states for each country in your database. From there, it's trivial, you just repopulate the state list based on the value selected in the country list.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi ,
Iam newbee in foxpro.
I tryed to create foxpro database via program using the foolwing code.but it throw the error
ADOX.CatalogClass dbcreate;
dbcreate = new ADOX.CatalogClass();
string conPath = "Driver= {Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\\Tamil\\FPDB.dbc";
con.ConnectionString = conPath;
dbcreate.Create(conPath);
MessageBox.Show("Sucess");
|
|
|
|
|
What is the error ? Does Fox Pro support creating databases like this ? Why are you using FoxPro ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi all
i have got a doubt
now i have 5 webpages every page has got database operation..
now while using database which way is cheap work to the server
1) opening connection and closing it when ever page requires a database connection
or
2)keep it open the database connection and close it when application is getting closed
|
|
|
|
|
kalyan_2416 wrote: now i have 5 webpages
you might want to try the Asp.Net forum for your web based questions
Also, the information regarding the architecture you have is insufficient. Can you enter each page independently of the others? or are they in some sort of order?
in either case, its usually better off to abstract your database operations& and therefore connection) to a separate layer.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
|
|
|
|
|
As long as you have database connections in the pool and you close/dispose of the connections, and you use the same connection string to connect to the database, then option 1 is going to be the better solution. Option 2 means that you have to leave a connection open - which is bad news if the server wants to recycle the database process, or the connection disappears for some reason and you attempt to do a database operation with a connection that is no longer valid.
Never design a system that keeps a resource open any longer than it necessarily has to - it just doesn't scale well.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
can anyone help me out about inheritance?
i have a base class inherited from a usercontrol. This base class contains a imagelist with 12 bitmaps and a datagrid, build in designtime.
Now i created 10 new classes inherited from my base class and weird as it is. the image list is copied and not inherited. changing the bitmaps in the base class doesn't change the ones in the other 10 inherited classes..
result is that i have to modify it for each of the classes. Another bad thing is that each class hass his own resource file containing the bitmaps. so 75kb x 10 = 750kb. i suppose this is no inheritance like i known it in Delphi, this is copying source.
Is there a way prevent copying the bitmaps but actually inheriting?
thx
Kurt
|
|
|
|
|
topcatalpha wrote: Is there a way prevent copying the bitmaps but actually inheriting?
Sounds to me like the bitmaps are not static, so a copy is created for every class instance. This would occur if they were 10 different derived classes, or not. Make them static.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Okay, Thx. i'm Gonna try that..
greetz
|
|
|
|
|
Wel,
i had the know it in advance, but i guess it's not possible to set a designtime created control as static.
So this seems to be a huge bug or missing functionality in C#.
Protected is not good enough, private is no option and static is not possible.
Even if you set it back to private in the parent form, the other derived forms still have the imagelist and you cannot delete them anymore...
So again this isn't inheritance, this is copying code.
But thx for you're time anyway.
greetz
Kurt
|
|
|
|
|
I'd Love to Have a ScrollBar which I can paint on my own. The Two Arrows for Up/Down and the actual Bar. I found a link on skinning Scrollbar on codeproject.com but it sort of was very lengthy. So is their an easier way to paint Scrollbars just as we paint other Controls???
Thanks...
|
|
|
|
|
I have a custom class having two members (a String object and a RegistryKey object). I have declared the class as Serializable and implemented the Iserializable interface. When I run the code ... an exception is thrown at the line where I try to serialize the RegistryKey object. My understanding is that this object also has to be serialized. But this cannot be done as RegistryKey class is sealed. Is there any procedure to serialize .NET class library objects?
I have to write my custom object to a file. My object contains other class library objects. Is there any alternative? Any help or suggestions are appreciated.
Varun Rokkam
|
|
|
|
|
Maybe you can exclude it from serialization and write a class that converts it to a string or other serializable object.
greetz
Kurt
|
|
|
|
|
Can any one tell me how to program the control "ExchangeTreeViewControl"?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
hey , i am trying to figure , how can i add an onClick Event to
DataGridViewButtonColumn.
1.as for now i gata a datagridview which one of its columns is a DataGridViewButtonColumn , and i want to make an event so when the user click on any of the buttons in the column that event will fire.
2. another funny thing i cant find where i can change the default color of the button it seems no mater what i do to change it using the class properties it doesnt change.
thanks for helping , i didnt find any articles about that ,
peace
Net
|
|
|
|
|
|
How would i add a bitmap for my mian windows app to load up??? in this program:
#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
Michael
(Up and coming Game programmer)
EST
|
|
|
|
|
How do i link bitmaps to load with my game app window??Like if i'm using Dev-C++ Windows App Templete and want to link a bitmap with it in C. ( btw everything i'm talking about is C not C++)
Here the app program :
#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "NinjaWars";
PAINTSTRUCT paintStruct;
/* Device Context*/
HDC hDC;
/* Text for display*/
char string[] = "Hello, World!";
/* Switch message, condition that is met will execute*/
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Ninja Wars", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
Michael
(Up and coming Game programmer)
EST
|
|
|
|
|
MMaines2005 wrote: (Up and coming Game programmer)
Not very far, apparently
1 - try using meaningful ( or at least different ) subjects for different questions
2 - You're not likely to find much help here, given that you want help coding in C and on an unusual compiler, but especially not in the C# forum. The visual c++ forum is your best bet.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi its muneeb,
i am using File.Move(sourceFilename, destFilename)method in my windows service, where "sourceFilename" is path of file placed on another IP Address i.e: 12.15.200.114, and my system IP Address is 12.15.194.251, i am getting an exception while calling this method "can't find the file'\\12.15.200.114\Files\abc.pdf'", even it exists !!!!.
I also made a mapdrive (Z:\) for the other system in my system, and made path z:\\Files\\abc.pdf, but Again its not working
To check this out i made a console application for both scenarios and made the same process it is working good, but not working in my windows service.
Their may be an issue for system rights and service logon, but i checked my service with my user account, administrator account and local system account.
Plz help me out, bc its getting to late....
Muneeb
|
|
|
|
|
i make a software help to connect many device with PC,use COM1 in PC.it sent a syntax(have adrees of receiver),and after a little time the device(receiver) sent data to PC in COM1
my problem is if it ask all device,and wait the answer all device,it used many time.that is bad
I want it work multitasking-it ask a device,and when it wait for answer,it can ask other device...
note:COM1 only can sent or receive at the moment
leo
|
|
|
|
|
nta_3886 wrote: help me quickly
Not only is that not a useful subject, it is rude.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Aw crap, I hit the Spam button when I tried to hit the 5, sorry.
|
|
|
|
|