|
You would think the C# compiler would be intelligent enough to handle that. Maybe the co/contravariance stuff in C# 4.0 will simplify such scenarios...
|
|
|
|
|
i tried i got error,
string not recognised as valid datetime.
i used many formatings "mm/dd/yyyy",...
same error
|
|
|
|
|
You need to change your stored proc, too. If your stored proc is like this:
CREATE PROCEDURE SomeProc
(
@filldate varchar(10),
@freedate varchar(10),
@name varchar(50)
)
Then you need to change that to:
CREATE PROCEDURE SomeProc
(
@filldate datetime,
@freedate datetime,
@name varchar(50)
)
And get rid of your conversion in the stored proc. You can't convert in both places...either convert in C#, or convert in the stored proc. If you convert in the stored proc, you will have to manually reformat the freedate and filldate strings to conform to the datetime format required by SQL Server to pass them in and convert them in the proc. Converting to DateTime in C# will be simpler, and a more stable implementation, than reformatting and converting in the proc.
|
|
|
|
|
hi,
i declared as datetime in stored procedure.
yeah iam trying in C#.
ALTER PROCEDURE InsertSuite
@filleddate datetime,
@freedate datetime,
@nameofcustomer varchar(50)
AS
BEGIN
SET NOCOUNT ON
Insert into PresidentialSuite(DateWhenFilled,DateWhenFree,NameOfCustomer)
values (@filleddate,@freedate,@nameofcustomer);
END
dont know why iam getting such error.
thanks
|
|
|
|
|
What is the error you are currently getting?
|
|
|
|
|
"String was not recognized as a valid DateTime."
though whatever conversions i used and formats iam getting same error.
|
|
|
|
|
Ok, it sounds like your input string is not in a known date time format. Can you paste a copy of the datetime string your inputting?
|
|
|
|
|
i inputed different formats 2008/02/02,02/02/2008,02/02/2008 00:00:00,
by changing formatting style from / to -,2008-02-02,02-02-2008...
|
|
|
|
|
As far as I can tell, all of those are valid. That would mean that something is happening to your input between the time you enter it, and the time you try to convert it. Debug your code, and look at what you are actually retrieving from your gridview, and make sure your getting the right information.
|
|
|
|
|
When I am declare "private Label[,] life = new Label[20, 20];"
And
"life[i,j].Click += new System.EventHandler(ClickLaBel)"
A problem was occured :
"Error 1 Use of unassigned local variable 'j'"
I don't know why ?
Can somebydy help me !
Sorry for my english.
Thank for all support !
|
|
|
|
|
breakvn wrote: Use of unassigned local variable 'j'
J doesn't have a value when you are registering the event. First assign a value for j (and i).
modified on Thursday, January 8, 2009 11:26 AM
|
|
|
|
|
Thank . So ,can you tell me how to use eventhander ...
I need detail .
Thank
|
|
|
|
|
You could try something like (don't mind about the typos):
Label tempLabel;
for (int i = 0; i<20; i++) {
for (int j = 0; j<20; j++) {
tempLabel = new Label();
tempLabel.Click += new System.EventHandler(ClickLabel)
life[i,j] = tempLabel;
}
}
|
|
|
|
|
Did you assign Label instances in your array? Initializing the array initializes all members to null.
|
|
|
|
|
breakvn wrote: Use of unassigned local variable 'j'
means j has no value yet (it is local, hence not initially zero), yet you are already reading and using it.
|
|
|
|
|
As the title is saying that shortcuts aint working(ie. Ctrl+A) in TextBox when MultiLine is true. I have tried to use my own code but i'm still hearing system exception beep when i press Ctrl + A.
private void ABCText_TXT_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyData == Keys.A)
((TextBox)sender).SelectAll();
}
any idea ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I just created a text box then enabled multiline and tested. Control + A works fine.
You may need to give some more information about your problem. Esp in regards to any properties you set to the text box
|
|
|
|
|
this.headerText_TXT.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.headerText_TXT.BackColor = System.Drawing.Color.White;
this.headerText_TXT.ForeColor = System.Drawing.Color.DimGray;
this.headerText_TXT.Location = new System.Drawing.Point(7, 24);
this.headerText_TXT.Multiline = true;
this.headerText_TXT.Name = "headerText_TXT";
this.headerText_TXT.Size = new System.Drawing.Size(306, 53);
this.headerText_TXT.TabIndex = 31;
this.headerText_TXT.WordWrap = false;
this.headerText_TXT.TextChanged += new System.EventHandler(this.headerText_TXT_TextChanged);
thats all that TB have
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
ok. dont see no probs there. have you tried a new project with just a textbox? did you say it works when multiline is false?
|
|
|
|
|
musefan wrote: did you say it works when multiline is false?
yes, it works if i set it False
perhaps its a bug in vista as usual
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
well that def is a strange one.
I using XP so cant test on vista. Are you using latest .Net Framework (3.5)?
Seems on some forums issues where found with earlier versions but i cant say i have read much detailed info on the matter.
|
|
|
|
|
It works fine for me on both Vista and XP. I am using Framework 2.0.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
damn, i just have installed
Microsoft .NET Compact Framework 1.0 SP3 Developer
Microsoft .NET Compact Framework 2.0
Last System Update : 1-05-08
never thought about it as VS installs Framework as well(at least V.2.0 not compact)
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Cant see line like this.headerText_TXT.KeyDown += .
Have you missed it while copying it here or in the code as well?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
i removed that
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|