|
hi all,
I need to rename Column "address" of TEST Table to "Name".
MY SQL Query is like this:
alter table test modify column address to Name char (50)
after I run this in SQL Query analizer,I am getting following error:-
Error:
Incorrect syntax near the keyword 'column'.
Can any one tell me How to fix this error?
thanks in advance..
|
|
|
|
|
sp_rename
Live Life King Size
Alomgir Miah
|
|
|
|
|
Problem when try to save icon with a color depth of 16bit or higher:
I try to extract an icon from an exe/dll file by using API ExtractIcon. Then I got the handle of the icon. I use Icon.FromHandle(hIcon) to create the instance of the Icon, then use Icon.ToHBitmap() to convert it to an Image instance.
When I use Image.Save(filename, ImageFormat.Icon) method, it save the Icon to an Png format image file. ( But when I use Icon.Save(stream), then save the stream to a file. The format is ok, but the color drops to 4bits(only 16 colors) (.
But if I draw the icon to a window, it is 16bits in color depth, no colors lose.
Who can give me a solution to save the icon(16bits or higher)?
I'm using WinXP.
E-mail: zc_djx@hotmail.com
I'm learning VB.Net & C#, you are always welcome to help me!
|
|
|
|
|
hi,
how can i put string formatting to my textbox?for example i want user to input the date so i want to have two "/" in the textbox to have the "yyyy/mm/dd" formatting
thanks
|
|
|
|
|
You need to format the string first, then pass it to the textbox. Or if you want to type it and see it formatted as you type, you need to write your own textbox, with the existing textbox as a base class, and format the string yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi,
i've to set some conditions to my program. user has to enter a string of 9 letters + numbers eg. x1234567y OR 12 numbers eg. 111111111111 before hitting the ok button (this ok button in my 1st form will direct me to my 2nd form if i keyed in correctly). the system will do a pop-up box telling u if u had keyed in an invalid no, that is not 9 letters + numbers nor 12 numbers.
can someone teach me to link the forms by adding in the needed codes with some explanation if u can, to my codes given below, in a way as simple as possible?
here's part of my codes for the 1st form:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
///
/// Summary description for MedicalApplication.
///
public class Form1 : System.Windows.Forms.Form
{
.
.
.
.
.
.
private void button8_Click(object sender, System.EventArgs e)
{
<<button8 will="" link="" to="" form="" 2
="" }
here's="" 2:
using="" system;
using="" system.drawing;
using="" system.collections;
using="" system.componentmodel;
using="" system.windows.forms;
namespace="" windowsapplication3
{
="" <summary="">
/// Summary description for ToCreatePatientFileInDatabase.
///
public class ToCreatePatientFileInDatabase : System.Windows.Forms.Form
{
.
.
.
.
.
.
Thanks! i really appreciate your help..
|
|
|
|
|
How do you want to link your forms ? The most obvious way is to pass an instance of Form1 into Form2, or the variables Form2 needs to know about. The other thing you can do is set up delegates to tell Form1 what is happening in Form2.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i've heard of this solution but i do not noe how to go abt doing that. i've done form 1 n form 2 using visual studio .net.. but after i finished my form 1 and form 2, i do not noe how n where exactly to add in the codes in order for my button in form 1 to link to form 2.. i've tried numerous times but met wif errors.. i seriously donno wat went wrong.. i guess i didnt declare certain things... now when i run my program i can only see form 1.. when i click on the button in form 1, it cant link to form 2.. i hope someone is kind n free enough to explain why, where n how exactly to add the required codes in my program so that i can link my forms up.. please help.. thanks..
|
|
|
|
|
private void button8_Click(object sender, System.EventArgs e)
{
<
|
|
|
|
|
HURRAY!!! THANKS SOOOO MUCH!! =DDD
|
|
|
|
|
I have 4 arraylists. One of which has an array of dates that I want to sort, but I need the other 3 arraylists to be sorted in the same order as the corresponding date order. What is the best way to do this? I don't have to use arraylists, but that is what I'm used to so that's what I'm using right now
|
|
|
|
|
The other arrays have other data that relates ? So ar1[0] and ar2[0] ( etc) all relate to one another ? Put your data in a struct, and set up a sorting function that sorts them based on date. If your data is connected, you should not disconnect it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yes, they are all related to eachother. Could you give me an example of how to use a struct?
Thanks
JGA
|
|
|
|
|
|
Example:
public struct My4Datas: IComparable
{
public DateTime DateOfBirth;
public string FamilyName;
public string FirstName;
public bool Married;
public My4Dates(DateTime dateOfBirth, string familyName, string firstName, bool married)
{
this.DateOfBirth = dateOfBirth;
this.FamilyName = familyName;
this.FirstName = firstName;
this.Married = married;
}
public int CompareTo(object other)
{
return this.DateOfBirth.CompareTo(((My4Datas)other).DateOfBirth);
}
};
Somewhere others:
ArrayList myList = new ArrayList();
myList.Add(new My4Datas(...));
myList.Add(new My4Datas(...));
myList.Sort();
foreach (My4Datas data in myList)
{
string name = data.FirstName + " " + data.FamilyName;
}
Good Luck!
Niedzi
|
|
|
|
|
hi all,
In my program, I create a new winform from the main window form.
Then I minimize the newly created form while the program run.
How can I un-minimize the win-form in program(not maximize it) ?
And also, when I close the window form manually while it run,
and find that the winForm variable is still not null ? why ?
And how to completely disposed or null the window form in the program ?
Thank all
|
|
|
|
|
You can set it's initial state in the forms designer. Afterward, this.WindowState = FormWindowState.Normal;
It's not null because there's no reason for it to be. Set it to null yourself if you want to, it won't speed up disposal any more than it's going out of scope ( I wouldn't think ). But it's common to call a dialog and after it's been shown, request some data from it, so having it set itself to null would be counterproductive, as well as an unnecessary bit of magic.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
Can I use c# to program the MSN to include it to be part of
my software to provide chatting function ?
Many thank !
|
|
|
|
|
|
I have a barcode scanner here, which can send bar codes as text, or work as a USB HID barcode scanner. I have no idea how to access the data in the second case, despite some heavy googling. Can anyone give me some pointers ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have a question on how a thread return its control to the main program
thread(which run the GUI). The problem is that the main program thread
will generate thread to run other task and to a certain point, I want the generated task-running thread return task to the main program thread to continue running task. Is it possible and how to do that ?
Thank
|
|
|
|
|
Are you looking for the Join method on the System.Threading.Thread class?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for your reply.
What I want to do is as follow,
1. The main thread running the main window GUI as window form
which can accept user input all the time.
2. The second thread running some task,
and after the task is finished, the thread need to ask
main window form(controlled by the main thread) to display some
child window. But I find that the child window will not function
properly as two threads try to control the same GUI at the same time.
So I want to pass the control from the second thread to the main thread
and let the main thread open the child window itself.
Then how can I do that ?
|
|
|
|
|
You're looking for the Invoke/BeginInvoke methods on System.Windows.Forms.Control . Calling Invoke or BeginInvoke on the form, will call the delegate passed as a parameter on the main thread, which is exactly what you want. This[^] might help you understand it better.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks so much ! It is what i need exactly.
|
|
|
|