There are as many ways to do this as there are people answering this question. Most of them depend on what mechanism you're using to access your database - Entity Framework - ADO - LINQ to SQL, or whatever. I personally prefer ADO, and I've written a reasonably generic DAL object to do it.
It can process stored proc calls or straight-up queries, and can map the returned data set to any object.
Beyond that, your question is so vague that there's nothing more I can suggest
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
t's not hard, it's easy - once you learn how to do it.
Just to add to what Richard gave you, the whole code is along the lines of:
using (SqlConnection con = new SqlConnection(strConnect))
using (SqlCommand cmd = new SqlCommand("SELECT Age, Description FROM myTable WHERE ID = @ID", con))
using (SqlDataReader reader = cmd.ExecuteReader())
int age = (int) reader["Age"];
string desc = (string) reader["Description"];
I have c# windows form application which displays the real time data from a board. I want to plot this data in a point graph in c#. Help me with this. I have given my code below which displays the data from board.
public partial class flow_click : Form
I am trying to plot the flow rate value(micro litres) and time(seconds) . so flow rate is my y axis and time is my x axis . whenever i click on button a new flow rate value is obtained which should to be updated on the graph
I have used all types of coding to remove the textbox but no use. I found few posts on Google search but the textboxes are associated with either a button control or checkbox control, using which, the deletion happens. I want the textbox to be deleted, if it is selected (meaning, the cursor is blinking in the text input area). I also tried setting textBox.Enabled=false; but no use as a statement textBox.Enabled=true; doesn't bring the textbox to life at all.
//if (virtTxtBox.BorderStyle == BorderStyle.FixedSingle)
//Determine the Index of the Button.
int index = int.Parse(TxtBox.Name.Split('_'));
label1.Text = index.ToString();
//Find the TextBox using Index and remove it.
TextBox txbx = (TextBox) pictureBox1.Controls.Find("txt_" + index, true);
label1.Text = txbx.Name;
pictureBox1.Controls.Remove(pictureBox1.Controls.Find("txt_" + index, true));
Hi, I said I experimented in various ways. Even after you commented about me using so many remove codes, i ensured they were not involved in the process and yet I could not achieve my objective of getting the textbox control(s) off my big picture box.
I searched online for 3 speech pronunciation libraries: "System.Speech.dll, Microsoft.Speech.dll and Interop.SpeechLib.dll". I want to know their time and origin, in which 3 libraries easy to use to write code ? Which library supports many countries' voices ? Which library is the most popular with programmers ? In the future, which 3 of the libraries will drop out ? et... ?