|
hi
U can set property i.e repeater1.RepeatColumns =11 and Repeater1.ReapeatDirection=repeatFDirection.horizental
just see, then give
|
|
|
|
|
but there is no property called repeatColumns and repeatdirection. Is there anyother way?? it might be in framework 1.1. i'm using 2.0 version.
|
|
|
|
|
Check DataList control
[^]
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
hi all
On my computer this string "22-1-2007" considered as a valid date , but on the client computer its not, its throw an exception when I convert it to datetime , because the system date format is MM-dd-yyyy.
So what I have to avoid this problem ?
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Tamimi - Code wrote: On my computer this string "22-1-2007" considered as a valid date , but on the client computer its not, its throw an exception when I convert it to datetime , because the system date format is MM-dd-yyyy.
So what I have to avoid this problem ?
It depends on where the date string came from. If it was generated internally and is never displayed to the user before becoming a DateTime object then my recommendation is to always use ISO date format (year-month-day).
If the string did come from user input then you'll have to look at localising your application.
|
|
|
|
|
Actually its come from user input
thank you.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Here are some options:
:: Use a standardised date format, like ISO 8601: yyyy-mm-dd.
:: Use ParseExact so that you can specify the exact format.
:: Specify a CultureInfo or FormatInfo when you parse the date. You should really do this every time you convert culture dependent information.
---
Year happy = new Year(2007);
|
|
|
|
|
thank you Guffa
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Hello!
Is there something like OpenFileDialog but which only returns a path and not a file?
/Regards
|
|
|
|
|
hi
use the FolderBrowserDialog in the forms namespace
|
|
|
|
|
|
how can i move a label that is in a panel? i dont know what to do in the draganddrop event of the panel. how do i relocate the label? do i need the pointtoclient?
here's the code:
static void newPanel_DragDrop(object sender, DragEventArgs e)
{
}
static void newPanel_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
|
|
|
|
|
hi
Just see this code for tabcontrol,selecting the required tabpage from tabcontrol1 and dragging form tabcontrol1 and drop it tabcontrol2.
I hope this will be helpful for u.
private void tabControl1_MouseMove( object sender, MouseEventArgs e )
{
if ( e.Button == MouseButtons.Left )
tabControl1.DoDragDrop( tabControl1.SelectedTab, DragDropEffects.All );
}
private void tabControl2_DragEnter( object sender, DragEventArgs e )
{
e.Effect = e.Data.GetDataPresent( typeof( TabPage ) )
? DragDropEffects.Move
: DragDropEffects.None;
}
private void tabControl2_DragDrop( object sender, DragEventArgs e )
{
TabPage DropTab = (TabPage)( e.Data.GetData( typeof( TabPage ) ) );
tabControl2.TabPages.Add( DropTab );
}
WiNNING IS NOT OUR DREAM,IT'S A HABIT
Have a nice evening
|
|
|
|
|
Hi All,
I am developing a windows application. In that application I have to write an entry in eventlog at the time when the application is closed. The problem is that application dont have any UI(User Interface) so it can closed only through taskmanager.
So is there any method or exception to catch it and then send an entry catching it in eventlog.
Regards,
Parag
|
|
|
|
|
i need to know that if many values are entered into a c# form, then i want to add all those in
the dataBase.so what will be the code lines.plz reply someone
|
|
|
|
|
Create a SqlCommand to INSERT the data in the database.
SqlCommand cmd = new SqlCommand();
cmd.Connection = aConnection;
cmd.CommandText = "INSERT TableName(Column1, Column2, Column3) "+
"VALUES (@Value1, @Value2, Value3";
cmd.Parameters.Add("@Value1", theFirstValue);
cmd.Parameters.Add("@Value2", theSecondValue);
cmd.Parameters.Add("@Value3", theThirdValue);
cmd.ExecuteNonQuery();
You will have to replace theFirstValue , theSecondValue and theThirdValue with appropriate values. Also, you will have to restructure the INSERT statement to match your database. I've also assumed that you have a connection (aConnection ) to the database.
|
|
|
|
|
hi
First write StoredProcedure like for Insert
Create StoredProc nameofStoredProc
(
@firstname varchar(20),
@lastname varchar(20))
as
insert into tablename
(
firstname,
lastname
)
values
(
@fisrtname,
@lastname
)
then start writing ADO.net code
SqlConnection con=new SqlConnection("userid=""; password="";DataSource="");
con.Open();
SqlCommand cmd=new SqlCommand("nameofStroredProc",con);
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameter.Add(new SqlParameter("@firstname",SqlDbType.varchar);
cmd.Parameter.Add(new SqlParameter("@lastname",SqlDbType.varchar);
cmd.parameter[0].value= txtFirstName.text;//textbox value
cmd.Parameter[1].value=txtlastName.Text;//textbox value
cmd.ExecuteNonQuery();
con.Close();
WINNING IS NOT OUR DREAM, IT'S A HABIT
HAVE A NICE DAY
|
|
|
|
|
dornala wrote: SqlConnection con=new SqlConnection("userid=""; password="";DataSource="");
A SqlConnection needs both a server and database name. Also, It is better to use a trusted connection than supply a user name and password in plain text.
|
|
|
|
|
hi
Just Iam specifing a simple connection for an example.
It is good practice to give entire connection object.
|
|
|
|
|
dornala wrote: It is good practice to give entire connection object.
I don't understand what you mean. What is a simple connection? The only way to connect to a database with ADO.NET is with a connection object.
|
|
|
|
|
Hi
I wonder if anyone can help with this one, I've tried casting round on the net but couldn't find a solution.
I'm working on an MDI winforms app which contacts a web service to retrieve data. I use the MdiChild form Icon, linked to a Timer, to mimic am animated gif whilst the app is away fetching data - giving the app users a sense that something is happening:
<br />
private void TimerIconWorking_Tick(object sender, System.EventArgs e)<br />
{<br />
if (this.Icon.Equals(this._IconWorking)) <br />
this.Icon = this._IconWorking90;<br />
else if (this.Icon.Equals(this._IconWorking90)) <br />
this.Icon = this._IconWorking180;<br />
else if (this.Icon.Equals(this._IconWorking180)) <br />
this.Icon = this._IconWorking270;<br />
else if (this.Icon.Equals(this._IconWorking270)) <br />
this.Icon = this._IconWorking;<br />
else
TimerIconWorking.Enabled = false;<br />
}<br />
This works prefectly well while the MdiChild WindowState is Normal, however, once I maximize the form the MdiChild Icon does not get redrawn via the timer event. [Note this is the MdiChild (form level) Icon, not the MdiParent (application level) Icon.] The event fires fine, the code above gets executed as expected, but the Icon is not refreshed - except when I click off the app while the timer event is executing; then the redraw happens... (I think this is a clue but I'm not sure how to interpret it!)
I've tried to force the app to refresh by adding something like this to the event above but to no avail:
<br />
if ((this.WindowState == FormWindowState.Maximized)&&(this.MdiParent != null))<br />
{<br />
}<br />
1) Is there any obvious way to force a refresh the MdiChild form Icon whilst the form is maximized?
2) If the MdiParent.Menu area (where the MdiChild.Icon resides when the MdiChild is maximized) is rendered by Windows, rather than by the MdiParent, is there any way to force Windows to render this area of the MdiParent?
Cheers
HN3
|
|
|
|
|
Hi,
Try to use this line of code to refresh instead the Refresh() method.
Application.DoEvents();
|
|
|
|
|
Hi there,
Thanks for taking the time to reply, unfortunately this doesn't have any effect.
Cheers,
HN3
|
|
|
|
|
i want to reterive from dataset to fill my report
but i don't know how to do that
can i body tell me how
ma_refay
|
|
|
|
|