|
|
|
Hi All,
Greetings. I've to assign the enum value to a object property. Which shows the following error.
Cannot convert type 'string' to 'Common.Enumerations.OffDate'
searchUIO.OffDate = (OffDate)ddlOffDate.SelectedValue;<br />
in this (OffDate) is an enum. the drop down list will contain the values lastweek, lastmonth like that. so i have to assing the value to the lefthand site object.
thanks in advance
Regards
babu
|
|
|
|
|
Take a look at the static Enum.Parse method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
As enum is an int type, you could make the enum casting with the SelectedIndex method.
searchUIO.OffDate = (OffDate)ddlOffDate.SelectedIndex;
All the best,
Martin
|
|
|
|
|
Thank you for your response. But i need to take the text value from the dropdown list.how i can do that??? Could you tell me the solution.
regards
babu
|
|
|
|
|
Have you tried the solution "Stefan Troschütz" posted?
|
|
|
|
|
Can i make a program that get some text from user and convert it to a sound ?
how make that ?
thanks
|
|
|
|
|
There was an API in C++ for converting text to speech. It sounded terrible. There's nothing built in standard, that's for sure.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You need a Text To Speech interface.
Such an interface is provided by Microsoft free and is called SAPI (Speech API) but i think that it was going to be upgraded and change name. Sorry i haven't gotten around it since 2003.
Need to know stuff.
SAPI is something like DirectX. It's Microsoft attempt to provide a generic interface for each interface realted to Speech Applications. Theretically each provider would comply and make his engine SAPI compliant.
SAPI when i used it in C++ it was very harsh. Even harsher than DirectX and there is not a lot of development going on, to find easily help
SAPI comes with the speech engine of Office intergrated. This means that without the need of a powerfull engine you can run your tests.
I think SAPi was renamed to ATL.
|
|
|
|
|
Sarafian wrote: I think SAPi was renamed to ATL
This is definately wrong. ATL has nothing to do with speech.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
My bad. I thought i remembered it correctly. I remember something that resembles it with 3 letters.
Anyway sorry for the misinformation
|
|
|
|
|
I found this.
SAPI[^]
For the needs of the original message there is this interesting part
Managed code Speech API
A managed code API is being developed by Microsoft which has similar functionality to SAPI 5 but will be more suitable to be used by managed code applications. The new API is part of .NET Framework 3.0 and will be available on Windows XP, Windows Server 2003 and Windows Vista.
The existing SAPI 5 API can also be used from managed code to a limited extent by creating COM Interop code (helper code designed to assist in accessing COM interfaces and classes). This works well in some scenarios however the new API should provide a more seamless experience equivalent to using any other managed code library.
|
|
|
|
|
Hi, I have an App with two windows forms. When I click a button on the main form it opens up the second form. How can I make it so only one instance of the second form can be opened at one time. As it is now a new instance of the second form opens every time i click the button. /thanks for an answer
|
|
|
|
|
Make the second form a member variable. As it's obvioulsy modeless, you should do that anyhow. Check if it's not null and visible before doing anything else in your click handler.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi, can you elaborate on your answer? A sample code perhaps?
|
|
|
|
|
I need to create a XML document from a schema dynamically without using any tool (XSD.exe). Kindly help.
|
|
|
|
|
Yogesh Choudhary wrote: without using any tool (XSD.exe).
In other words, you want to do it by hand ?
The thing to remember is, a schema defines more than one layout, how do you choose which of hte options a schema gives, you will follow ? Do you include all optional nodes? Nodes that can appear many times, how many of those do you put in ?
And, a schema gives you no idea of what is valid data to put inside the nodes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Well you can say that. My schema will remain the same but nodes can change so i need to that dynamically. What I have thought of is to convert schema to dataset and from that to XML document. Is this ok? Do you have any code snippet for this.
|
|
|
|
|
I don't have any snippets. Why do you need to do this ? A schema is for validating XML, not vice versa. It is of value only when the XML comes from somewhere else and you want to make sure it's valid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I need to enter the values in that schema with the nodes and get an xml from that.
|
|
|
|
|
I understand what you want to do. I was just saying, why do you need to create dummy XML ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
YOu tell me what should i do in this type of scenario
|
|
|
|
|
I don't know what the scenario is. I asked you why you need dummy XML files to match an XSD, you didn't answer.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes I need a dummy XML from the XSD file
|
|
|
|