|
Thanks for all your help.
Found the problem.The problem was when I added my storeprocuded didn't have nvarchar. it was varchar.
Once again thanks.
|
|
|
|
|
Hi,
I'm writing an application that uses an System.Speech.Synthesis.SpeechSynthesizer to generate some speech.
The class has a method to set the output to the default audio device or to another audiostream (System.IO.Stream).
But how can I tell it to use just another audio device? I think I might have to get a Stream object of that other device to pass it to the SetOutputToAudioStream() method of the synthesizer, but I have no clue how to do so.
Any help would be appreciated.
Michael.
|
|
|
|
|
This MSDN[^] page might help?
Edit: Sorry just realised this if for mobile devices!
Dave
|
|
|
|
|
This[^] may be more help!
Dave
|
|
|
|
|
Thanks a lot, that should do it. I'll try it later.
|
|
|
|
|
Ok, here's a new problem: Filler()(from the link above) is called, while the synthesizer is still filling the stream with data. As you can imagine, this results in a disaster. So I cannot make the stream thread-safe (because can't control the filling end) and even if i could, I would have gasps in my output because the buffer would be filled like this:
(1 =data in cycle 1
2=data in cycle 2
0= no data)
11111111111111111100000000000000000
|stream is filled until here
22222222222222222220000000000000000
while it should look like this:
1111111111111111112222222222222222222
Any ideas?
Edit:
Ok, finally got it - i had to wrap the whole synthesizer-class to make the stream thread-safe, but finally, it works. Thanks @ all.
modified on Tuesday, June 24, 2008 2:46 PM
|
|
|
|
|
Hi, has anybody written or come across a thread-safe generic dictionary collection? I need it for a project of mine, I want a fully thread-safe dictionary (ie. with no lock wrapping add and remove only) but with high performance as it will be used in a web application.
Thanks for any help.
|
|
|
|
|
Why not just override where you need to?
|
|
|
|
|
Lock wrapping is required for thread-safety. Without the locking you get dirty reads which can cause a lot of problems in the system.
Of course with only add and remove methods I am left wondering how you would use the dictionary.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I'm sorry, I don't quite understand your reply. Locking is fine in Add() and Remove() but locking the dictionary every time you try to look up a value is certainly an overkill, this is what I meant when I referred to performance.
Ennis Ray Lynch, Jr. wrote: Of course with only add and remove methods I am left wondering how you would use the dictionary.
I meant using lock in only Add() and Remove(), I didn't mean a dictionary which only exposes Add() and Remove()
|
|
|
|
|
If there are lots of concurrent reads and only occasional writes, you could try to use the ReaderWriterLockSlim[^].
If that's still too much locking for your app, you're looking for a lock-free hash table[^]. (according to the presentation, this starts to be faster than locking at >32 processors)
|
|
|
|
|
This is just what I'm looking for, I think I'm going for the ReaderWriterLockSlim as the dictionary will be used mostly for reading with occasional writes.
Thanks a million!
|
|
|
|
|
|
I'm using the .net Settings feature to keep track of user preferences for a click once app.
Problem is that every time I release a update, the settings all reset to default.
(This is because the settings are being stored in the users documents and settings folder under a folder that includes the version number, so when I release and update and increase the version number, the app can no longer find the file to load the settings from, so goes back to the default)
Is there a way to cause it to ignore version numbers and just save the settings in a non version specific folder?
Cheers.
Simon
|
|
|
|
|
The best way is to write specific code to seek the previous versions configuration and import it into the new version. This is because future versions, could in theory, break and not rely on the same configuration information.
Otherwise, just use non-api methods to access folders and pick a good place ... like create a common in your company folder created for the user for the version information.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks Ennis
Ennis Ray Lynch, Jr. wrote: The best way is to write specific code to seek the previous versions configuration and import it into the new version.
Tricky because the folder the config file is stored in looks like some form of hash combined with part of the assembly name. I don't know the rules for generating this path.
Ennis Ray Lynch, Jr. wrote: This is because future versions, could in theory, break and not rely on the same configuration information.
Thats fair enough, I can kind of understand why MS didn't just make it work. Weirdly though, I wrote quick test app to make sure it wasn't something wrong with my code, and it behaved as I described (settings reset after version increase). But then I went back to it after writing the post, and now it works fine settings are maintained between version increases exactly as I want them to be.
Ennis Ray Lynch, Jr. wrote: Otherwise, just use non-api methods to access folders and pick a good place ... like create a common in your company folder created for the user for the version information.
Yeah, I thought about doing this, but it feels like going back to the old .ini file way of doing things. I thought 'settings' was supposed to remove the need for doing messy things like this.
Simon
|
|
|
|
|
You should be able to use the Upgrade() method available with the built-in settings to "upgrade" the user.config created with your new revision with the settings from your old revision. You don't have to worry about where the old user.config is located.
I typically create an 'ApplicationVersion' setting which I compare to Application.ProductVersion each time a program starts to run. When they are no longer equal, I use the Upgrade() method to ensure my settings get brought over from the prior version's last known settings. For example...
if (MyApp.Properties.Settings.Default.ApplicationVersion != Application.ProductVersion)
{
MyApp.Properties.Settings.Default.Upgrade();
MyApp.Properties.Settings.Default.ApplicationVersion = Application.ProductVersion;
MyApp.Properties.Settings.Default.Save();
}
Something like that will hopefully work for you.
|
|
|
|
|
Brilliant. Thanks
I'll try it out when I'm back in work tomorrow.
(Although, like I said in my other post, it suddenly seems to be just working now although I'm sure it shouldn't be.)
Cheers
Simon
|
|
|
|
|
Hello!
I have a datagridview consisting of two columns and many rows. One of the columns consists of texboxes and one of comboboxes.
Sometimes the user wants to select many of the rows and change either the textboxvalue or the combobox value for all the selected rows.
Is it possible to do this in a sample manner?
|
|
|
|
|
|
No, it's a C# windows application.
|
|
|
|
|
it can be done if the user hold the CTRL key while clicking on the rows
or by clicking a row and dragging it...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Yes, I manage to select several rows but I can't change the values for all of the selected rows.
|
|
|
|
|
youll have to foreach them... somethink like this
foreach(DataRow myRow in DataGridView.SelectedRows)
{
}
changing the data in these rows are not as straight forward as it seems... have you been able to do that with just one row?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
We have developed an application and published it. In application we have implimented scanners and camera(Canon Power Shot A640). When we published it was throwing some error as scanner dll is missing. So we pasted all dll's in server where we have published. Scanner Error was solved.
After this app was opening and when we cliked on camera module it is giving error PRSDK.dll is unable to load. after this when we click any button in this screen it is showing unable to load CDSDK.dll.
Please any one help in solving this...
How to include PRSDK.dll n CDSDK.dll while publishing?????
And one more thing while developing this application we have reffered these dll's from bin folder.
waiting for ur reply's.....
Rashmi.M.K
|
|
|
|