I am such a newbie for C # that I have to ask questions before starting!
Do I want to enter a numerical number in a text box, send it to an enclosed SQL compact database, check to see if the number is in the table, if the data returns to the correct form is. If false, then I will run some code that will get the information and update the table, add it to the table, send the form. Others, to create SQL tables through C #, does anyone have to help me prototype this concept so that I can start reading concepts so that I can start building this part of my project? Thank you.
There are many different ways to do what you're describing. A quick and easy way to handle this scenario would be to use SQL for SQL Server for WPF and database access for user interfaces. There are several tutorials for tutorials on both technologies, but here are the basic steps:
Step 1: Create a new WPF project in Visual Studio - Step 2: Add a LINQ to the SQL class and map it to your database - Step 3: Edit the main window and add the input textbox, check button and the result text box
Main-window Sample code for XML (note it's quick and dirty):
& lt; Window x: orbit = "WPFPlayground.MainWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http: // schema .microsoft.com/config / 2006 / Xaml "title =" main window "height =" 350 "width =" 525 "& gt; & Lt; Grid & gt; & Lt; StackParental Orientation = "horizontal" height = "30" & gt; & Lt; Text box name = "inputtextbox" width = "50" /> & Lt; Button name = "check button" content = "check db" click = "checkbutton_link" /> & Lt; Text box name = "resultsTextbox" width = "100" /> & Lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; / Window & gt; Step 4: To handle button click events, edit the code behind MainWindow.xaml.cs
Click the sample code in the main window for the event ( Quick and dirty again)
Private Zero CheckButton_Link (Object Sender, Routing Aventure E) {// SQL DataContacte var DB = new MyDDDNET (from my LINQ); // Try to find the input that matches the text in InputTextBox var data = db.TableName.FirstOrDefault (r = & gt; RIID == InputTextBox.Text); // was able to find a match record, so show result data if (data! = Zero) {ResultsTextBox.Text = data.EventDesc; } And Step 5: Know some great practices and do not use this sample code: when there is no match, then what do you need to do? )
Have Fun
Comments
Post a Comment