|
The error message means that you have two names in the query that doesn't exist in the database. Check the names of the table and the fields.
---
b { font-weight: normal; }
|
|
|
|
|
ODBC Syntax for queries expects parameters to be represented by '?' placeholders. Named parameters are not supported.
Change your query to
"SELECT studenti.user_name,studenti.Nume, " +<br />
"studenti.Prenume, cursuri.denumire_curs, note.nota, note.data " +<br />
"FROM studenti INNER JOIN (cursuri INNER JOIN [note] ON " +<br />
"cursuri.id_curs = note.id_curs) ON (studenti.id_stud = note.id_stud)"+<br />
" WHERE studenti.user_name= ? AND note.data < ?";<br />
then be sure to add your parameters in exactly the ORDER they appear in the query. You can use any names for the parameters (just don't duplicate names) since they are ignored.
|
|
|
|
|
HI ALL !
i want to use a special format for MaskedTextBox , For Example an arabian Date like this :"yyyy/mm/dd".because Date Format for MaskedTextBox is a "christian format ".how can i do it ?
thanks for any help !
s_mostafa_h
-- modified at 14:54 Sunday 4th June, 2006
|
|
|
|
|
If you are using VS then in the design mode, you can click once on it, and a little arrow will apear, in there, you can set the Mask.
On the window that opened you can Costum design your Mask.
Good-Luck.
|
|
|
|
|
thanks , but i want to give an error message if the user enter a wrong format (for an arabian date like :14--/--/-- or yyyy/mm/dd).
regards,
s_mostafa_h
|
|
|
|
|
Can't you use a DateTimePicker? it's alot easyer!
You either can open the Calander, or either you can choose the year, month or day like list-box, very comfterbale (bahhh don't know english), and is set to your home language.
|
|
|
|
|
At design time, in the property window, set the mask property to the mask you want to set.That's it...
Wasif Ehsan
|
|
|
|
|
Wasif Ehsan wrote: Can't you use a DateTimePicker ?
I want to use a Persian or Arabian Date . How can I change DateTimePicker Control to Persian or Arabian Date ... .
thanks a lot .
s_mostafa_h
|
|
|
|
|
What i have is a panel (in a windows form, let's call it mypanel) with no active scrollbars (autoscroll set to false). I don't need them and I don't want them to appear. In my code I use mypanel.HorizontalScroll.Value = value to scroll the panel. This code appears in the scroll event of another scrollbar in the form. This works fine, except one thing. When I move the slider of the other scrollbar mypanel of course gets repainted. But when repainting the scrollbars of mypanel are painted, too. Of course this is a temporary effect, because they disappear later in the painting cycle. So a painting cycle looks like this: Scrollbars painted, scrollbars removed, .... And this over and over cause I'm dragging a slider so the sroll event occurs many times. This leads to flickering when dragging the slider. So how can I get rid of the scrollbars in mypanel getting painted? Of course I could move the objects in mypanel manually without using the horizontal scroll, but this would be a worse solution. So any help is appreciated.
-- modified at 14:28 Sunday 4th June, 2006
|
|
|
|
|
I did this using a datagrid but the same result will apply.
Make an inherited user control that inherits the panel and simply set the width of the vertical scrollbar to 0 (and the height of the horizontal scrollbar).
This should give you the hidden scrollbar effect that you want.
|
|
|
|
|
.......
"WHERE studenti.user_name= '"+user+"' AND note.data < '"+date+"'";
the error comes from comparing the note.data which is also a date in a table built in MS Access,
this is the definition for date : DateTime date = DateTime.Now;
i must convert date.To"Something" or something like that but i dont know to what to dont get this error
is posible or must i do it somehow else?
Thanks
-- modified at 12:44 Sunday 4th June, 2006
|
|
|
|
|
Consider using parameterized queries. This would avoid type conversion errors like this, and is better practice since it avoids vulerability to SQL Injection Attacks.[^]
|
|
|
|
|
Access uses the # character around dates, not apostrophes.
Use parameterized queries, as Rob suggested, it will put the proper characters around the value regardless of what database you are using.
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone know how to change the location of a button using programming. I'm going to use it to make "simple" and "advanced" options in my search program.
Thanks
Hengy
I like Pie
|
|
|
|
|
Please don't double post, your old thread is perfectly suited for this question.
Anyway, here is the solution:
Button b = new Button();
b.Location = new Point(10, 10);
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sorry for the double post...
I have another problem:
when the doesn'tpick anything from a combobox, it says:
System.NullReferenceException was unhandled
but in my code, I put a default setting in my switch.
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked != true)
{
MessageBox.Show("Search");
}
else
{
switch (comboBox1.SelectedItem.ToString())
{
case ("Mininova"):
string targetURL = @"http://www.mininova.org";
System.Diagnostics.Process.Start(targetURL);
break;
case ("TorrentSpy"):
string targetURL2 = @"http://www.torrentspy.com";
System.Diagnostics.Process.Start(targetURL2);
break;
case ("IsoHunt"):
string targetURL3 = @"http://www.isohunt.com";
System.Diagnostics.Process.Start(targetURL3);
break;
case ("MyBitTorrent"):
string targetURL4 = @"http://www.mybittorrent.com";
System.Diagnostics.Process.Start(targetURL4);
break;
default:
MessageBox.Show("Please select a website to search.");
break;
}
}
}
any ideas?
thanks for the help... I seem to be asking alot of it today!
Hengy
I like Pie
|
|
|
|
|
If no selection is made, then the target of the switch() statement is null - comboBox1.SelectedItem is uninitialized, so you can't call the ToString() method on it.
change the if -else statement to:
if (checkBox1.Checked != true)
{
...
}
else if (checkBox1.SelectedItem != null)
{
switch (comboBox1.SelectedItem.ToString())
{
....
}
}
else
{
MessageBox.Show("Please select a website to search.");
}
Last modified: Sunday, June 04, 2006 6:20:40 PM --
|
|
|
|
|
I am developing a serch application. I want to it to have a "Simple" option and an "Advanced" option. When I press the Simple button I want some options to disapear (which I can do) and the form to get smaller (reduce Height only).
I need help with code for making the form smaller. I have tried using the MSDN site examples, but Visual Studio 2005 doesn't recognize:
Form1.Height = 145
It says I need aditional information (System.Windows. etc.)
Hengy
I like Pie
-- modified at 10:18 Sunday 4th June, 2006
Hengy
I like Pie
|
|
|
|
|
What's the exact error message? This works fine:
this.Height -= 150;
this.Width += 200;
this.Height = 300;
If you want to change these values from outside the form, then you need to replace this with an instance variable of your form, like this:
Form1 form = new Form1();
form1.Height = 200;
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks
The second piece of code didn't work, but I played around with it and finally did get it to work.
this.Height = 145;
Hengy
I like Pie
|
|
|
|
|
You can't directly access the Form1 class and call Height as a static method.
You need an instance of your Form1 object, which you already have, namely form
Form1 form = new Form1();
form.Height = 200;
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I'm a little lost in what you said... I'm kind of new to C#, but thanks anyways.
Hengy
I like Pie
|
|
|
|
|
Whenever you need to resize your form, you can reset the size property of your form like
this.size=new Size(newWidth,newHeight)
As soon as this line will be executed, you form will be resized. Here you can give the height and width whichever you want. But remember, you need to take into consideration the new sizes of your controls on the form since they may not look pretty with the resized form. That's it...
Wasif Ehsan.
|
|
|
|
|
Hi
I'm trying to have my text bounded by a circle, so that it follows its edges. How can I do this?
cheers
|
|
|
|
|
There are articles on the Internet (I remember seeing at least one on this site) about that, with code.
The case of a circle is relatively easy, mostly a task in converting polar to Cartesian geometry. Break your text into letters and determine the angle for each letter based on the tangent at that point.
The hard part isn't making your text fit on a circle, but the leading between letters. If you're using a variable pitch font, how good the text looks is largely about pair kerning between letters. It's about combinations like "oo" and "oi" not having the same spacing. TrueType contains some hinting, so maybe there's some way to tap into that and pull out instructions from there.
|
|
|
|