|
hi,
Please tell me how can i use another application(*.exe) outside my program.
And one more problem i face is how can i rename file ? For example: i have a picker, after i choose a file and fill the new name, this file will be save with the new name.
thanks in advance.
|
|
|
|
|
abiisalwayshappy wrote: Please tell me how can i use another application(*.exe) outside my program.
You mean run another program from your program? Look into System.Diagnostics.Process class.
abiisalwayshappy wrote: how can i rename file ?
System.IO.File.Move can "move" a file from its current directory and into its current directory with a new name.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
you can start an external process by using Process.Start from System.Diagnostics namespace.
to rename a file you can use File.Move in which you need to specify source and target.
Saqib
|
|
|
|
|
Hi, I have some code in a C++ dll that I'm calling from a .NET 2005 C# application. Inside the DLL method that I'm calling is a process that I'd like to be informed of its current running status (0-100%).
My question is how would I implement some runtime communication between my .NET app and the dll process so as to be able to update a status bar in the .NET app.
Many thanks in advance....
Glenn Manion
GIS R&D Unit
NPWS, NSW, Australia
|
|
|
|
|
Hello Glenn,
You can implement callback system. In which your C++ dll call some method which you can catch in C#. For c# you can create function call delegate.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Hi Divyang,
Thanks so much for the help. I implemented the call back function as you suggested and this was exactly what I was after.
All the best and thanks again.....
Glenn Manion
GIS R&D Unit, NPWS
NSW, Australia.
|
|
|
|
|
How would I get the speed(kbps) of a file upload?
Thanks,
Sean
|
|
|
|
|
Assuming you're talking about file upload speed of the network, you'll need to transfer a file over the network (assumedly to a website), measure how long it took, then do a little arithmetic to figure out the bits pers second of the file upload. There's no magic to it.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
How can i add a bitmap into resource folder of the solution by code in design mode? (No right click on the folder... but automatically by code)
|
|
|
|
|
See this one : http://msdn2.microsoft.com/en-us/system.resources.resourcewriter.aspx
|
|
|
|
|
About trancparency key in windows forms...
-Does it runs with color depth of 16-bit or 32-bit ?
-And what if i need to make it run on 32-bit ?
-And if it runs only in 16-bit color mode, how can i change the color depth to 16-bit programmatically ?
thanks in advance.
|
|
|
|
|
It runs on whatever color depth you're using.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
So, what's the problem with my Laptop?, is the problem with the display adapter or with the version of VS.NET?
can anyone plzzzz suggest a problem to check on it.
pssss:
i have 2 versions of VS, VS2005 on my laptop, and VS2003 on my PC,
my laptop is HP nx6110 with Intel Express Display Adapter 128 MB - running on intel pentium M processor
and my PC has ATI Radeon 9200 128 MB - running on Intel pentium 4 processor,
plzzzzzzzzzzzzzzzzz help meeeeeee
|
|
|
|
|
Hey Mr.Christian Graus can i send you my source code to test it..????
|
|
|
|
|
I have some grid controls on a form that are using data adaptors to fill the grid directly from the SQL Server data base. I have added an even handler on exit of the form to commit changes but the changes are not getting written back to the data base.
Here is my code -
this.speciesTableAdapter.Fill(this.markingDBDataSet3.Species);
private void MasterData_FormClosing(object sender, FormClosingEventArgs e)
{
SpeciesGrid.CommitEdit(DataGridViewDataErrorContexts.Commit);
SpeciesGrid.Update();
}
I must be missing something or I am totally on the wrong track. Any ideas?
-- modified at 18:42 Monday 22nd May, 2006
|
|
|
|
|
Ok. To update the database based on changes you have made in the datagrid you must be calling the DataAdapter.Update() method. This takes two arguments: Your datatable/dataset (this will be the datasource of your grid), and (if you hand it a dataset) the name of the table.
Ex.
dAdapter.Update(somedataset, "Table");
or
dAdapter.Update(sometable);
But you do need to specify an insert command in order for this to work. If a standard insert query is fine, you can use the command builder class. So, if you are using OleDb it would be like this:
OleDbCommandBuilder cmdBuild = new OleDbCommandBuilder(dAdapter);<br />
dAdapter.Update(somedataset, "Table");
Hope that helps!
|
|
|
|
|
I am using a SqlDatatAdaptor and when I try this solution, it builds without any errors but when the update is executed, I get the following exception error -
Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
This is my code -
SqlDataAdapter dAdapter = new System.Data.SqlClient.SqlDataAdapter();
dAdapter.Update(markingDBDataSet3, "Species");
|
|
|
|
|
You need to include the SqlCommandBuilder to make your update command for you:
SqlDataAdapter dAdapter = new SqlDataAdapter();
SqlCommandBuilder cmdBuild = new SqlCommandBuilder(dAdapter);
dAdapter.Update(markingDBDataSet3, "Species");
Without this, the update will not work.
|
|
|
|
|
I added the code as sugested -
SqlDataAdapter dAdapter = new SqlDataAdapter();
SqlCommandBuilder cmdBuild = new SqlCommandBuilder(dAdapter);
dAdapter.Update(markingDBDataSet3,"Species");
I am now getting a different error.
Error -
The DataAdapter.SelectCommand property needs to be initialized.
|
|
|
|
|
Sean, you got me pointed in the right direction. I worked with one of the more experienced Windows developers here and we managed to cobble together the following which seems to be working. Evidently it needed a reference to the table adaptor and needed a select command added to the data adaptor.
Here is the code -
SqlDataAdapter dAdapter = new SqlDataAdapter();
SqlCommandBuilder cmdBuild = new SqlCommandBuilder(dAdapter);
dAdapter.SelectCommand = new SqlCommand("select * from Species");
dAdapter.SelectCommand.Connection = speciesTableAdapter.Connection;
dAdapter.Update(markingDBDataSet3,"Species");
Thank you very much for your help!
|
|
|
|
|
Ohh sorry I would have told you to put a select command in when initializing the data adapter but I thought you had just left it out so you wouldnt take up to much room in your post
Good to see you got it workin'
|
|
|
|
|
Hi there,
I'm using DataGridViewCheckBoxColumn, when a check box is unchecked sometimes I get the value {} (it's not a string value) instead of false. I want to get the value false or true.
Does anybody know why do I get the value {} and how can identify this value programatically?
Thanks in advance,
Elvia
PS: Windows application in Microsoft Visual C# 2005
|
|
|
|
|
Hi,
Iam using datagridview,How to add a new row to the datagrid view?
In insert button i wrote this code,
dataGridView1.Rows.Add(3);
when i run this code,it is giving the following exception
exception: rows cannot be programatically to the datagridview's collection when control is databound
In save button i wrote like this,
private void button1_Click(object sender, EventArgs e)
{da.Update(ds,"emp");
}
It is giving the following exception:
Update requires a valid InsertCommand when passed DataRow collection with new rows.
Please help me.
Thanks In Advance
|
|
|
|
|
You need an introduction. Try this article[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Is there a way to access the resources in referenced assemblies ?
e.g. <asp:Label ID="Label2" runat="server" Text="<%$ Resources:MyResources, MyText %>"></asp:Label>
but with a MyResources assembly that was referenced instead of resources in the global_resources folder
|
|
|
|