|
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
|
|
|
|
|
If i have this codesnippet and the specified url doesn't exist.
How do i catch the webexception?
WebClient laddaner = new WebClient();
laddaner.DownloadStringCompleted += new DownloadStringCompletedEventHandler(laddaner_DownloadStringCompleted);
laddaner.DownloadStringAsync(new Uri("http://thisurldoesnotexist.com"));
Right now i get a TargetInvokationException thrown at Application.Run(new Form1()); in Program.cs (the program is a simple Form-app)
This doesn't work:
WebClient laddaner = new WebClient();
laddaner.DownloadStringCompleted += new DownloadStringCompletedEventHandler(laddaner_DownloadStringCompleted);
try
{
laddaner.DownloadStringAsync(new Uri("http://thisurldoesnotexist.com"));
}
catch(WebException)
{
MessageBox.Show("Error!");
}
|
|
|
|
|
try using WebClient.OpenReadAsync() and check the OpenReadCompletedEventArgs.Error in the handler for OpenReadCompleted event.
"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
|
|
|
|
|
Works perfekt, thanks alot
void blabla()
{
WebClient laddaner = new WebClient();
laddaner.OpenReadCompleted += new OpenReadCompletedEventHandler(laddaner_OpenReadCompleted);
laddaner.OpenReadAsync(new Uri("http://adress.com"));
}
void laddaner_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error.Message == null)
{
StreamReader sr = new StreamReader(e.Result);
string s = sr.ReadToEnd();
}
else
MessageBox.Show(e.Error.Message);
}
|
|
|
|
|
I have 2 forms.
disable some buttons;
form1 call some bool function on form2(via a delegate).
this function will print some stuff on a textbox in form1 via a cross thread handler.
if the function return true then enable the buttons.
simple enough. but vs2005 give me this error:
"Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on."
Does anyone knows what is going here? And how i can solve it?
Donkaiser
|
|
|
|