|
You cannot copy DataRow objects from one DataTable to another unless they have the EXACT same schema.
Your better option would be to create a new DataRow in the target table and copy the values you want from the source table.
|
|
|
|
|
i did it with creating row instance for both the tables (table1 and Table 2) and then set Table1Row.ItemArray = Table2Row.ItemArray; and then added the row to table one at desired location. it worked fine....... thanx for your replies it was of grt help
|
|
|
|
|
I wanted to create a database very quickly and since I am most familar with C# and COM (and C++), I have used Access via Interop. I have had no problems reading my database but modifying it is another story.
Basically the following doesn't work:
recordSet.Edit();
recordSet.Fields[4].Value = "Free";
recordSet.Update(2,true);
There are plenty of VB examples of this stuff that apparently work. The exception I am getting on the Update is "Invalid Argument". I suspect very strongly that there is a type mismatch between the C# string type and the Access/SQL Text type. But how do you recast C# string to a SQL Text?
Interestingly using Encoding.ASCII.GetChars changes the exception to "Data Conversion Error" further indicating that I have in fact got a type mismatch.
So any sample code on what I suspect is a simple solution for those that know?
|
|
|
|
|
There is no mismatch between a .net string and sql varchar. Make sure the field is correct.
You should really spend some time learning ADO.NET, the benfits over the old, outdated DAO methods will be worth the time
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am not sure what use mean by field is correct. I have no trouble reading from the field like this:
string something = (string)recordSet.Fields[4].Value;
So why can't I write back a new value? Regards using DAO - I am using Interop to connect to the Access COM interface. So if you use accessObject.Application.DBEngine want is returned is a DAO.Engine . Is there a way of returning a ADODB Engine instead?
|
|
|
|
|
Hi all. . . . is there any solution to measure the WI-Fi signal strength in C sharp .net, or in any other language.
help will be highly appreciated.
|
|
|
|
|
A very quick google gave this[^] as the top result.
Learn to use Google: all I did was search for "measure the WI-Fi signal strength in C sharp" which I pasted from your question...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
You have asked this in the Q&A forum as well. Don't do that! It is called cross-posting and is very rude.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
You can go there[^] having like same problem with perfect solution.
I hope it will works for you.
|
|
|
|
|
Hi Guys,
i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting:
"'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level"
any ideas on how i can change this access level?
i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with!
sorry if this is dumb question, i'm a newbie!
Many Thanks,
Phil
|
|
|
|
|
The constructor DomainController() is protected, so is inaccessible to you.
I saw a method getDomainController(DirectoryContext), maybe that's the way to go.
If you can read this, you don't have Papyrus installed
|
|
|
|
|
Try using DirectorySearcher class.
|
|
|
|
|
Thanks for your help guy, this is how i did it...
DirectoryContext dCon = new DirectoryContext(DirectoryContextType.Domain);
DomainController dc = DomainController.FindOne(dCon);
ActiveDirectoryReplicationMetadata adMeta = dc.GetReplicationMetadata(name);
foreach (AttributeMetadata a in adMeta.Values)
{
}
|
|
|
|
|
have you changed your id?
Hey ho, glad you got it sorted.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
i have a home and a work account - dont know how i managed that!
|
|
|
|
|
hi,
i am beginner in c#, i need tour help, i want two break textbox text in two part
For example
textbox1.text = "ABT-001"
ABT-001 break into "ABT-00" and "1"
textbox2.text = "ABT-00" and textbox3.text="1"
Hope you understand by question
Thanks
|
|
|
|
|
You are looking for the String.Substring method[^]
What it does it returns a new string, cut down from the original. You just have to specify the start position of the new string (in characters from the beginning of the original) and the length of the new string, in characters:
int len = textBox1.Text.Length;
textbox2.Text = textBox1.Text.Substring(0, len - 1);
textbox3.text = textbox1.Text.Substring(len - 1); (if you don't specify the length, you get the whole remaining string).
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Why would anyone vote you down for that?
Beginners have to start somewhere, and English isn't everybody's native language.
Compensated.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: Why would anyone vote you down for that?
A trend that seems to be increasingly common. There are obviously a (I hope small) number of people whose only contribution to CodeProject is to down vote those questions they deem unworthy. I guess in a population this size there will always be a percentage of morons.
I must get a clever new signature for 2011.
|
|
|
|
|
Richard MacCutchan wrote: morons.
I can think of another word which fits them better. Starts with "A"...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Assets ?
I know the language. I've read a book. - _Madmatt
Two letters away from being an asset
|
|
|
|
|
Close enough!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Amazing - you got downvoted!
Compensated.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Now, I wonder who did that? Was it an As...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
What pattern do you want to use to break the text apart? Do you want to break it based on the length? Is it based on a particular string pattern, e.g. XXX-NN representing the first part? Before anybody can offer you a definitive answer, you need to explain the problem fully.
|
|
|
|