|
hello every body,
i use a datagrid view bounded to a datasource, but i can't update the changes happens in it.
although, i've added the insert, update & delete queries i also use a dataset with a tableAdapter .
and this what iam doing in the onSaveButton_Click:
try
{
dataGridView1.EndEdit();
this.visitorTableAdapter.Update(this.omvDataSet.visitor);
omvDataSet.AcceptChanges();
MessageBox.Show("Changes saved successfully");
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
so, what is the right solution to accomplish what i want.
Regards
|
|
|
|
|
hi,
what's wrong now? code looks good, but you don't need to .AcceptChanges() because .Update() does it for you.
kind regards
|
|
|
|
|
ok i removed .AcceptChanges()
now i tried to delete then i had this exception:
Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.
regards
|
|
|
|
|
Hi,
are you sure you filled all commands of DataAdapter? There are InsertCommand, UpdateCommand, DeleteCommand and SelectCommand (last is filled by constructor, normally).
King regards
|
|
|
|
|
Hi,
yes i did filled these commands by the dataset designer but, i found that i have to add them into the properties window by myself and now it's working.
thanks for your help, i really appreciate it.
Regards
|
|
|
|
|
Hi to all
I am trying to add windows assembly to the GAC using the following command in the command prompt.
C:\Program Files\Microsoft Visual Studio 8\VC>gacutil /i C:\WINDOWS\system32\odb
c32.dll
But it is not being install and I am getting the following error.
"Failure adding assembly to the cache: The module was expected to contain an assembly manifest."
I am not getting the reference of the assembly neither in the .NET Assembly nor in the COM objects.
Can anyone tell me how can I install this assembly in the GAC.
Thanks in advance
Amit
|
|
|
|
|
hi,
did you sign your assembly? Project Properties --> Signing --> Sign the assembly
kind regards
|
|
|
|
|
Hi,
why would you want that? the GAC is for managed code DLLs only, odbc32.dll is a native code DLL, it is fine where it is.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: why would you want that?
It doesn't match the curtains
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Computafreak wrote: doesn't match the curtains
You don't need curtains with Windows, Microsoft hid some termination commands under "Start", of all places.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
can you help me in solving <a* search=""> program?
I want it's algorithm or if it is possible it's code in C#2005.
thank you very much
|
|
|
|
|
amir_ahmad_yaghoobi wrote: is possible it's code in C#2005
Yes
...as you wanted one or the other then your problem is solved
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If only somebody somewhere would invent a technology that allowed you to search[^] over billions of pages of indexed content based on keywords. Why, if they could do that, they'd be rich - they might actually be worth 3 or 4 dollars.
If only... Sigh.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Welcome Pete [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The link below will solve your problems.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
how can i find number of days in a given year and month
|
|
|
|
|
Number of days in a year is a constant (varies for a leap year). Number of days in any given month is going to be a constant (except for February in a leap year). Which part of this are you having a difficulty with?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
thank you for your replay and you solved the problem and i remembered that if we want to know if February in a leap year or not by divided the year by 4 and if the result is an integer number it will be leap year such as 2004/4=501 this is a leap year and 2005/4=501.25 it's not a leap year
and i'll to try it by code
Many thanks for all
modified on Tuesday, June 2, 2009 3:48 AM
|
|
|
|
|
Ooh - not quite. If it's a century, it has to be divisible by 400 to be a leap year, so 2000 is a leap year and 2100 isn't.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Let us hope that his code will not have to run for a century.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
is 2100 really not a leap year?
EDIT: It's OK I WIKI it and got an answer
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
use modulus (provides the remainder after a division) not divide...
if(year % 4 == 0)
else
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Many Thanks and i'm very happy from Your cooperation
|
|
|
|
|
Ok this is what you should use instead...
if(year % 4 == 0 && year % 100 == 0 ? year % 400 == 0 : true)
else
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|