|
Yes, but as a DateTime, not as a String.
|
|
|
|
|
I meant that formatter to only be used in the case that the OP couldn't use parameterised queries, so he was building up the query string (where obviously everything must be a string). But you are right, I didn't make that clear, so I'll go and edit my initial message. Thanks!
|
|
|
|
|
Remove the single quotes for text fields if using alphabets in text. And # symbol to insert date.
|
|
|
|
|
i tried to use a new two parameters:
m_insert_cmd2.Parameters.Add("@DateStart", MySqlDbType.DateTime).Value = this.dateTimePicker1.Text;
m_insert_cmd2.Parameters.Add("@DateEnd", MySqlDbType.DateTime).Value = this.dateTimePicker2.Text;
and tried like this:
m_insert_cmd2.Parameters.Add("@DateStart", MySqlDbType.DateTime).Value = this.dateTimePicker1.Text.ToString();
m_insert_cmd2.Parameters.Add("@DateEnd", MySqlDbType.DateTime).Value = this.dateTimePicker2.Text.ToString();
the same problem is communicat:
String was not recognized as a valid DateTime.
my full query look like:
m_insert_cmd2 = new MySqlCommand("INSERT INTO tb_rezerwacja (kwota, ilosc_osob, w_tym_ilosc_dzieci, data_od, data_do, FK_pokoj_id, FK_zamowienie_id) VALUES (' 345', '3', '3', @DateStart, @DateEnd, @pokoj_id, @zamowienie_id)", m_conn);
on form i add 2 dateTimepickers like u see and in MySQL database the date fields are in Date format...
modified on Wednesday, July 20, 2011 3:00 PM
|
|
|
|
|
|
Hello Experts,
If i have a string "abc". then how can i get the shown output
a
b
c
ab
bc
ac
abc
In this output i do't need of ba or cab or cba.
Thanks
If you can think then I Can.
|
|
|
|
|
Is this, what you are looking for?
string value="abc";
string result=string.Empty;
for(int i=0;i<=value.Length-1;i++)
{
result+=value[i].ToString()+"\n";
}
for(int i=0;i<=value.Length-1;i++)
{
if(i<value.Length-1)
{
result+=value[i].ToString()+value[i+1].ToString()+"\n";
}
else
{
result+=value[0].ToString()+value[value.Length-1].ToString()+"\n"+value;
}
}
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
The Length of value is not fixed for 3
it can be increase and the result will be change according to input.
then how can i do that.
If you can think then I Can.
|
|
|
|
|
Length of string is dynamic too on my example.
Did you try my code to see result?
Which is result for you if the string is "abcd"
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
the result by program is :
a
b
c
d
ab
bc
cd
abcd
But Required result is :
a
b
c
d
ab
bc
cd
da
bd
abc
bcd
dab
....
abcd
..etc
If you can think then I Can.
|
|
|
|
|
Backtracking . You can search google to more detail .
I can it useful for you . Thanks !!
|
|
|
|
|
Homework question?
Should the output contain ACB? or strictly ordered?
|
|
|
|
|
A double iteration over the input string with position and substring length :
string str = "anystring";
for (int x = 1; x <= str.Length; x++)
{
for (int y = 0; y <= str.Length - x; y++)
{
Console.WriteLine(str.Substring(y, x));
}
}
Cheers
|
|
|
|
|
Hello Estys,
Thanks for your solution.But it is missing values.
Input : ABC
Output :
A
B
C
AB
BC
CA // Missing Value
SO pls provide the solution for that.
If you can think then I Can.
|
|
|
|
|
I didn't see the "CA" value, ouch!
Can you give an example of the expected output if the input is "ABCD"?
Or perhaps describe the situation in words? I suspect you're going to need some recursive algorithm.
Cheers
|
|
|
|
|
Estys wrote: input is "ABCD"?
Same question I asked
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Blue_Boy wrote: Same question I asked
Great minds think alike .
If you can read this, you don't have Papyrus installed
|
|
|
|
|
CA wasn't in the initial spec, but AC was. The OP needs to better define what the problem actually is (and why he wants to solve it beyond 'my homework says so').
|
|
|
|
|
You're right of course from a professional viewpoint.
Some people, non-native english speakers, have trouble finding the right phrasing of the question though, which leads to this kind of confusion.
I took a look at his profile, very interesting.
Personally, I usually like solving these kindergarten puzzles, even if it sounds like homework .
Cheers
|
|
|
|
|
Based on his/her profile description, he/she should be able to solve that problem.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
|
But he isn't asking for permutations..
|
|
|
|
|
I think he is asking combination.....
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
|
What you're looking for is the power set of "abc" (http://en.wikipedia.org/wiki/Power_set[^] )
If you go through all the 3-bit numbers (000, 001, 010, 011...) (i.e. the power set) and use the letters corresponding to 1's, that will give you all the permutations.
|
|
|
|