|
Hello,
I am using multiple SqlBulkCopy objects within multiple threads to write data into one common database table. The data is obtained via a custom DataReader implemented to read from a common data source.
So now I´m starting 3, 4 or 5 threads almost at the same time to write into the same data table and most times this all works out perfectly. But sometimes a deadlock occurrs on the server and one of the .WriteToServer(Datareader)-calls breaks with an exception. No matter, if I do or don't use 'implicit transactions' option.
So I am wondering how this can happen ? I am referencing the same target table on the server - so in my opinion it may happen that one transaction block the others - but there should never be a deadlock because there is no cyclic dependency of used ressources.
Or am I wrong with my assumptions ?
Does anyone have an idea what happens in this case ? Or did anyone experience the same problem ?
Thanks in advance for any ideas,
Juergen
|
|
|
|
|
Reason for this could be lock escalation where you have a conflict when sessions try to escalate the lock to cover the same area.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello Friends,
I'm developing an application that reads file properties and stores them in a MS-Access database. I need to know, what would be more efficient in terms of speed, the GetDetailsOf method or the FileInfo and DirectoryInfo classes.
|
|
|
|
|
Test them both and see.
Write the two methods of reading the file properties
Write a loop that repeats the file reading (say 1000) times. You need to do it lots of times because generally just doing it once will be so fast you can't time it accurately.
Use a System.Diagnostics.Stopwatch to time the loop. Repeat for both types of file read.
Simon
|
|
|
|
|
Like the other reply said, make two versions. But I'd suggest using a profiler to make the comparison, if possible.
|
|
|
|
|
HI,
I come from a dephi background and i am in the process of moving to c#.
In Delphi I can declare a file as being of a recordrtpe (or Struct in
c#).
i.e
FileName = File of TempRecType
where TempRecTypeis declared as
Record TempRecType
longint TempIntVal,
string[14] Shortstring,
shortint TempIntVal2
end;
To read from this file I would simply create a variable of TempRecType
and read the
file straight into the variable.
can anybody help me to do this in C#?
|
|
|
|
|
It should be possible to create a structure with a memory allocation that matches your file, using some attributes, but it's not trivial. Then it should be possible to read data into that structure.
I think that the simplest way is to just use a BinaryReader to read the file.
Note that a character in .NET is a 16 bit value, and the string in your file is probably encoded as 8 bit values. You need to specify an encoding that maps each character to an 8 bit value, like Encoding.ASCII or Encoding.Default (Ansi).
Also, you have to match the integer data types against the .NET integer types. How many bits are there in a longint and shortint? In .NET you have the specific Int16, Int32 and Int64 types (which maps against the aliases short, int and long in C#).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If the user then clicks on (Sub menu) on the menu then the Excel function wizard would come be launch showing the function and it's arguments with a link to the help files for the function.
|
|
|
|
|
Sorry, but just because you don't like the (correct) answer you were given the first time posting it again won't magic up a different one.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: because you don't like the (correct) answer you were given the first time posting it again won't magic up a different one
Maybe it works in some retarded parallel universe, but not here
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
dear all,
could anyone tell me how to use ErrorProvider to datagrid
|
|
|
|
|
|
Simon's answer will show the error icon next to the whole DataGridView . However, there is 2 properties for a DataGridViewRow and a DataGridViewCell called ErrorText which sets an error icon and an error message in a tooltip for a row and a cell respectively. Setting the property to an empty string removes the error icon and the message.
Eslam Afifi
|
|
|
|
|
Please try to refrain from using words like Urgent and Plz HELP in your subject line.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
smraj1503 wrote: project in vb.net using c# coding
|
|
|
|
|
|
You seem to misunderstand the purpose of this site. It's not freakin' rentacoder. You have a code problem, we help you with said problem. You want us to write the code for you, you pay us first. Welcome to the wonderful world of commerce.
|
|
|
|
|
Pete O'Hanlon wrote: You want us to write the code for you, you pay us first.
With the rate I charge for top quality code/product, he couldn't afford it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
With the rate I charge, I'd help him for free if I could.
|
|
|
|
|
Come on don't be so harsh on him. He wants us to write some code because we have lots of free time that's it. I will help you. Here is the code of C# written in VB.net for you
<br />
Sub Main()<br />
logoff(CodeProject.USER_NAME);<br />
startNewVenture(CURRENCY.USD.MILLION*10);<br />
hireNewProgrammers(5);<br />
while(1){<br />
makeThemUnderstandYourRequirements();<br />
}<br />
End Sub<br />
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
|
smraj1503 wrote: Iam doing the browsing center project in vb.net using c# coding
Thanks for the sig. You should let your RAC client know that you know nothing about computers, and give their money back. Perhaps there are real programmers in your area and you could get work cleaning their pools ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
smraj1503 wrote: vb.net using c# coding
Have you ever heard of what is C# or VB.NET before attempting to code in them? Quit programming immediately and try seeking a better career that befits your caliber.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Hello, your question is confusing and has resulted in rude replies which you should ignore if you really want to figure this out.
Can you please clarify what you mean by "in vb.net using c# coding"? Are you saying you are trying to understand an example you have seen in C# so you can code it in VB.NET? If so then the VB.NET forum is a better place to ask.
If you are coding in VB.NET then the VB.NET forum is a better place to ask in any case.
Are you asking how to use the timer control or how to log someone out of their computer in c#?
When you say "What is the coding" some seem to have assumed you want us to write your code for you, clearly no one here is going to do that for you but if you are just asking a question you will need to clarify it a bit more.
If you are just looking for help a better way to state this is "I need some help to understand how to do ..." followed by what you want to accomplish. Asking people for code here is generally taken to mean you are asking others to do your work for you and that is not a good thing.
Also when asking a question it's best to leave out any irrelevant information such as "BROWSING CENTER PROJECT" which probably means nothing to the people reading it and just adds to the confusion.
Please try again.
"It's so simple to be wise. Just think of something stupid to say and then don't say it."
-Sam Levenson
|
|
|
|