|
i think u need to call AcceptChanges() method on dataset
rahul
|
|
|
|
|
The point is that there aren't any changes in the dataset. That is the whole problem, changes made to the grid contents do not change the dataset.
|
|
|
|
|
|
Thanks, but I can do that just fine. This example is all on one Windows form. The problem occurs when I fill a dataset from a database at the server, send the dataset to the client, and the client binds the dataset to a datagrid.
When I do this, the datagrid does not update the dataset.
If I create a windows form with a datagrid on it, and fill the dataset using code on the same form, then changes to the datagrid update the dataset.
It is as if the compiler knows that the dataset was passed over the network and refuses to implement the data-binding in both directions
Nigel
|
|
|
|
|
im doing a project about RFID system registration..
database-ms access
database name=registerDBDataSet
table=ASAS
column=GAMBAR
in my form i have a gambarPictureBox,which retrieve the image from my pc(use browse button) from openFileDialog..
when run the program the image is open in the pictureBox and i want to save the image to database..
which way can i use?
since many coding that i search from internet using sql command,is there any other way to retrieve image from picture box and insert it into database?
the error happen when this code run:
private void saveButton_Click(object sender, EventArgs e)
{
this.aSASTableAdapter.Insert(nameTextBox.Text, tptLhrTextBox.Text, trhLhrTextBox.Text, jantinaTextBox.Text, kaumTextBox.Text, agamaTextBox.Text, wargaTextBox.Text, statusTextBox.Text, ICTextBox.Text,gambarPictureBox.Image);
this.aSASTableAdapter.Fill(this.registerDBDataSet.ASAS);
}
---->Error 1:The best overloaded method match for 'Registration.registerDBDataSetTableAdapters.ASASTableAdapter.Insert(string, string, string, string, string, string, string, string, string, byte[])' has some invalid arguments
---->Error 2: Argument '10': cannot convert from 'System.Drawing.Image' to 'byte[]' C:\Documents and Settings\fathiah.FATHIA-582A635D\Desktop\Registration\registerForm.cs
how to solve it..
please help me..
|
|
|
|
|
you need to save the picture as bytes not as system.drawing.image object. the Dtabase don't know object there are just 0 and 1
But please don't ask me how to convert a image into a byte array...
|
|
|
|
|
as both errors indicate - the last parameter expects a byte array (byte[]) but your passing an Image object. Convert the image to a byte array first (maybe by saving to a memory stream? - google for best solution!) then pass that to the method instead.
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
gambarPictureBox.Image.Save(memStream, gambarPictureBox.Image.RawFormat);
byte[] imageBytes = memStream.ToArray();
To load you'll have to do the reverse.
Dave
modified on Monday, June 2, 2008 6:37 AM
|
|
|
|
|
|
Hi there!
I finally got XP worked with win2k before. Iv'e installed VS2005 and though it could go on. i compiled my project (succeeded)[edit] c# framework 2.0.50727 [/edit]
press F5 and then........
"..Error while trying to run project....<br />
<br />
This application has failed to start because the application configuration is incorrect. Review manifest file for possible errors. Reinstalling the application may fix this problem. for more details, please ssee the application event log."
I think you know this message at all (I googled it, searched in several forums, tried the suggestions but no success at all)
Could someone give me a clue how to fix this error? i allready looked up in securty.config, manifest and spended 2 days to find a solution at all....
thanks in advance
Mathias
|
|
|
|
|
What does it say in the event log? It sounds like a missing dll - or one not in the expected location.
Dave
|
|
|
|
|
by event log you mean the manifest file don't you?
mathias
|
|
|
|
|
In the error that the OP posted it finished "please see the application event log" - so I figured that would be a good place to look!
Dave
|
|
|
|
|
You're saying that you've searched for the answer with no success for 2 days , but you didn't repair/reinstall, like the suggestion says?
I wouldn't have waited for more than 2-3 hours before I did a reinstall.
|
|
|
|
|
ähm are you sure you are a developer?? MY .exe should be reinstalled not VS2005.... so how will i reinstall a application that I'm developing in the moment??? if you could say me that i will become a rich man.
but thanks anyway found the error:
ClickOnce Securty Settings were enabled. I don't know why but I'm happy that i found this "bug"
thanks for your suggestions
|
|
|
|
|
Hi All,
I have given an interview. They asked me one question on OOP concept.
I could'nt able to answer, can anybody help me to find the solution?
Question
class a
{
private double myclass()
{
//coding stmt;
}
}
This class is kept in dll.
In main class you want to call method myclass how you will call b'coz that class is private method.
|
|
|
|
|
It's not possible to call the method directly as it is private. You may use reflection to do this, I guess.
|
|
|
|
|
The answer is that you don't, private members are accessible from inside that class only. You can work around this using reflection but unless you have no other choice you really really shouldn't do this.
|
|
|
|
|
You can do this using Reflection, but in an interview it's always worth pointing out that you SHOULDN'T do this because this is breaking the basic reasoning behind making a method private.
|
|
|
|
|
There's an easier answer than reflection: Add another function in class a that's public and calls myclass():
public double getMyClass ()
{
return myclass ();
}
Yes, it's a silly answer, but that was a silly question.
|
|
|
|
|
I want Visual Studio to auto-change the active project when I change sourcefiles. I don’t want to right-click a project an choose ”Set as startup project”. (VS 2005)
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote: I don’t want to right-click a project an choose ”Set as startup project”. (VS 2005)
so how does it know what you want to do? Guess?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
On the cpu I'm use now VS2005 automaticaly sets "active project" on the project that my current code-file exists. Current codefile = Selected i Project Explorer or active in code-view.
_____________________________
...and justice for all
|
|
|
|
|
Most of my projects are DLLs, many are Windows Services, setting those projects as Startup would not be wise.
|
|
|
|
|
Hi expets, I created a datagrid column as a templete column.It is a textbox field.So how i validate that templete column(textbox)?
CheeN
|
|
|
|
|
This[^] was my first hit when I googled. BTW, this question has to be in ASP.NET forum.
|
|
|
|