|
http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
Hi,
How can i send a message like MouseDown message without using win32 apis inC#.
|
|
|
|
|
have a look in to this http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
I want to search a file from server and want to copy it to the local disk.
how it is done?
|
|
|
|
|
You can search for a file.using Directory.GetFiles(FileName,SearchPattern);
And copy to local system using ftp request and response classes in System.Net.
Mean while what is your application is a client server apps or a web applicaiton ?
|
|
|
|
|
My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk.
I tried to searc using using Directory.GetFiles(FileName,SearchPattern);
but it is not at all serching.
|
|
|
|
|
Plz help me for the above..............
|
|
|
|
|
P_Elza wrote: not at all serching
Hope you are checking if the directory is existing using
Directory.Exists ?
P_Elza wrote: search the particular element from an xml file
Are the innertext's value assigned to the intended variables?
Probably debugging the app will help you understand where it fails.
|
|
|
|
|
Tis is working if the file is in my hard disk itself.
but not when it comes to server. If i map the server i can search.like
y:\\my folder\\myfolder
am tring to make an exe. different people will map to different drive.
so i cant give like that.should give like \\server\\serverfolde\\folder\\
|
|
|
|
|
Well, that will never work because a server must start with a double slash, so in your syntax this would be \\\\server\\serverfolde\\folder\\. You can, of course, prefix this with the @ sign so this becomes @"\\server\serverfolde\folder\".
Now, your application will need to have permissions to work with these folders - make sure that it has the permissions to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi
you can take the toolbox from openfiledialogbox1
|
|
|
|
|
I am tring to make an exe.
|
|
|
|
|
Hi,
I want to delete data from datbase by entering a year in text box. If the there no data then i want to show "the selected date does not exist". How can i do this? pls help me?
Please write code here........................
|
|
|
|
|
It should look something like this.
SqlConnection con = new SqlConnection(connecitonstring);
SqlCommand cmd = new SqlCommand("delete from table where year = @year",con);
cmd.Parameters.Add("@year",SqlDbType.Int).Value = int.Parse(TextBox1.Text);
if(cmd.ExecuteNonQuery() > 0)
{
Console.WriteLine("Record deleted successfully");
}
else
{
Console.WriteLine("No data found");
}
|
|
|
|
|
in select statement
strdelete="delete from tablename where datefield='date'
objsqlconn=new sqlconnection("user id=sa;password=;data source=servername")
objsqlconn.open
try
Dim vbmsg As String
vbmsg = MessageBox.Show("Are u sure to delete this record", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If vbmsg = vbYes Then
strdelete = "delete from tablename where datefield='date'"
objsqlcmd = New sqlcommand(strdelete, objsqlconn)
objsqlcmd.executenonquery()
Else
MessageBox.Show("There is no field exits")
End If
catch (ex as exception)
exception(ex.message)
end try
|
|
|
|
|
|
rohitsrivastava wrote: yes
|
|
|
|
|
Why do I get the feeling the OP is going to copy'n'paste the code thrown at him and wonder why it doesn't work?
|
|
|
|
|
How to Fill Combo Box From SQL2000 Tables
SAS
|
|
|
|
|
SqlCommand cmd = new SqlCommand("SELECT [field] FROM table",connection);
SqlDataReader dataReader = cmd.ExecuteDataReader();
while(dataReader.Read())
{
comboBox1.Items.Add(new llistItem(dataRead[0],dataRead[0]);
}
dataRead.Close();
Hope this helps
|
|
|
|
|
hi this is the coding to fill the combo
strselect="select fieldname from tablename "
objsqlconn=new sqlconnection("userid=sa;password=;data source=servername")
objsqlconn.open()
objdataset=new dataset
objsqlcmd=new sqlcommand(strselect,objsqlconn)
objsqldataadapter=new sqldataadapter(objsqlcmd)
objsqldataadapter.fill(objdataset,"Tablename")
cmbname.datasourc=objdataset.table("Tablename")
cmbname.displaymember="Fieldname"
cmbname.displayvalue="fieldname"
this is how to fill the combo
have a nice day
|
|
|
|
|
when I iterate through form controls and their child controls
it works fine for every thing else expect when it comes to menu items it only returns only
the top item and not the child ones
the code I am using is
void ModifyControls(Control.ControlCollection ControlCollection)
{
for (int i = 0; i < ControlCollection.Count; i++)
{
if (ControlCollection[i].GetType() != typeof(Menu))
{
Array.Resize(ref Controls, Controls.Length + 1);
Controls[Controls.Length - 1] = new MyControls(ControlCollection[i]);
Controls[Controls.Length - 1].SaveFormating();
ModifyControls(ControlCollection[i].Controls);
}
}
}
Thanks and Regards
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Greetings Amar,
If you look at how the MenuStrip control works you will notice that it houses a different type of collection, the ToolStripItemCollection in its MenuStrip.Items property. You need to iterate each ToolStripMenuItem in that collection to get its children.
After that, the ToolStripMenuItem has another ToolStripItemCollection in it's DropDownItems property, you now need to iterate through this collection to get it's children and so forth... consider the following example:
<br />
void ListControls(Control parentControl)<br />
{<br />
foreach (Control control in parentControl.Controls)<br />
{<br />
MessageBox.Show("Control Type : " + control.GetType().ToString() + "\n" +<br />
"Has Children : " + (control.Controls.Count > 0 ? "Yes" : "No") + "\n");<br />
<br />
if (control.Controls.Count > 0)<br />
{<br />
this.ListControls(control);<br />
}<br />
<br />
if (control.GetType() == typeof(MenuStrip))<br />
{<br />
foreach (ToolStripMenuItem toolStripMenuItem in ((MenuStrip)control).Items)<br />
{<br />
MessageBox.Show("---> Menu Strip '" + ((MenuStrip)control).Text + "' has '" + toolStripMenuItem.Text + "' as a child item.");<br />
if (toolStripMenuItem.DropDownItems.Count > 0)<br />
{<br />
}<br />
}<br />
}<br />
}<br />
}<br />
Basically, the MenuStrip needs to be treated like a TreeView as it can contain a complex hierarchy. I hope this helps... Have a great weekend!
Fernando Mendes
Senior .NET Developer, Architect
|
|
|
|
|
thanks for the help
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
In my application I need to use telnet to execute some commands so please help me to this.
How to connect to telnet and how to execute the commands in c#.net
Please help me on this
Thanks in advance
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|