I need to ask a question for the user. I would like them to enter the ID who's record they want to see. The user should input the ID. How can I do that in C#?
Asked
Active
Viewed 179 times
-4
-
Its not message box its input box. and what platform? asp.net or winforms or WPF? – Nikhil Agrawal Mar 24 '13 at 15:45
-
Have you written any code yet? It would help us to give you an answer if we see what you have so far. – Pete Garafano Mar 24 '13 at 15:45
-
Maybe this'll help: http://stackoverflow.com/questions/97097/what-is-the-c-sharp-version-of-vb-nets-inputdialog – Corak Mar 24 '13 at 15:47
-
no i have not written any code. i want to do searching in database. for this reason i need an input from the user. – user2202791 Mar 24 '13 at 15:48
-
i m using visual C# express edition 2008 – user2202791 Mar 24 '13 at 15:48
-
@user2202791, check this [SO Thread](http://stackoverflow.com/questions/97097/what-is-the-c-sharp-version-of-vb-nets-inputdialog) – rs. Mar 24 '13 at 15:50
-
Sorry gyz this didn't works....:( – user2202791 Mar 24 '13 at 15:55
1 Answers
1
You need to use vb input box. Add a reference to Microsoft.VisualBasic, InputBox is in the Microsoft.VisualBasic.Interaction namespace
Add do something like:
string input = Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title", "Default", 0, 0);

Emmanuel N
- 7,350
- 2
- 26
- 36
-
-
1Have u added references to `Microsoft.VisualBasic` and `Microsoft.VisualBasic.Interaction` namespaces? – Emmanuel N Mar 24 '13 at 16:34