Showing posts with label Source_Code. Show all posts
Showing posts with label Source_Code. Show all posts
Solved - "Are You Missing An Assembly Reference Error in Visual Studio"
These days i am working on speech recognization feature of c# in visual studio , for this i must have to include ---
System.Speech
namespace in my application...
namespace in my application...
and the problem arises here , when i include this namespace in my application - it gives me an error something like this--
"The type or namespace name 'Speech' does not exist in the namespace 'System' (are you missing an assembly reference?)"
First i thought that i am using older version of .net thats why i am seeing this error bcoz the Speech library is included in .net3.0 and later but actually i am using .net4.0, now that feel me odd ...... that i am using updated framework then why i am getting this error.....
Then i came with a solution that i have to add dll reference of this library ,then only i can include the specified namespace in my application, so to add reference , follow these steps:-
Then i came with a solution that i have to add dll reference of this library ,then only i can include the specified namespace in my application, so to add reference , follow these steps:-
1. Go to Solution Explorer Window.
2. Right Click References.
3. Click on Add Reference.
4. Select .Net tab.
5. Then search for your specified Namespace, in my case it is System.Speech, so select that namespace.
6. Now Click Ok.
and you are done, you will not see that error now........
Enjoyzzz.... :-p
Friday, November 16, 2012 | Labels: Asp.net, Source_Code, Tips'n'Tricks, Wpf |
Check DropDown List contains a value in Asp.net ????
I am quite sure, that u all wondering that what a foolish type of post is this bcoz i know that atmost all of you can do this, but i am sure the way to do this provided by me is surely effective then the way that you all have used.....I have seen many people write good coding, but, sometimes they don't pick efficient way to do somethings. When we do code reviews we can identify some code parts are very simple to implement but they implement it in a complex way, want to correct them. A simple scenario is, how to check a drop down contains a value. Some people are looping through all items and finding the item exists or not. Some people are doing some complex logic etc. But, below is what believe the good and simple way of finding a value is in drop down list of items :--------
- if (dropdownlist1.Items.FindByValue("someValue") != null)
- {
- dropdownlist1.SelectedValue = "someValue";
- }
Wednesday, October 17, 2012 | Labels: Asp.net, Source_Code |
How to place cursor at the end and begining of the text in textbox??????
Welll these days , i am working on a small project and i am actually using textbox.focus() method to make focus on textbox, it is all going well, but the problem is -- it is selecting whole text also, then what i do , i use textbox.deselectall() method to deselect the text, but now again a new problem arises ,it is placing the cursor at the beginning of textbox, and i want to place the cursor at the end of the text, so i come with a very small and interesting code to place cursor at the end of the text in the textbox.... Here is the Code:---
textBox1.Select(textBox1.Text.Length, 0);
Similary,if you want to place cursor at the beginning of the text in textbox, then use this code :---
textBox1.Select(0,0);
Saturday, October 13, 2012 | Labels: Source_Code, Wpf |
.png )