0

Hello, me and my programming group were given the task to build a program to save peoples information, for instance, Name, Last Name, Age, I.D., etc.

Is there a guide, A VERY BASIC GUIDE, to pass the values of, say, a text box to an SQL Database?

Or to make it easier for us, even save values as a string to a StreamWriter.

4
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by Shuco
0

StreamWriter is in essence file IO. So that should not cause that much of a problem.
And a VERY BASIC GUIDE to SQL Database? If I had one I would give it. But you alwyas have to set up a connection, sqlcommands(insert,delete,update). It is helpfull if you know what a DataSet is, what a DataReader is etc. In short see what ADO.NET can do for you.

0

I'm already familiar with SQL query command in SQL Server 2008, it's just that I don't know how to intertwine both C# and my SQL database.

So, is there a guide that demonstrates this process?

0

As I said, your F1 key has all the answers, it has examples of connecting to SQL, as well as how to maniuplate data and queries.

0

Hello, me and my programming group were given the task to build a program to save peoples information, for instance, Name, Last Name, Age, I.D., etc.

Is there a guide, A VERY BASIC GUIDE, to pass the values of, say, a text box to an SQL Database?

Or to make it easier for us, even save values as a string to a StreamWriter.

You mean something like this:

string dbConn = ConfigurationSettings.AppSettings["DatabaseConn"];
OleDbConnection loginConn = new OleDbConnection(dbConn);
loginConn.Open();

OleDbCommand getOwnerQuery = new OleDbCommand("SELECT EMPNAME FROM EMPLOYEE WHERE EMPNO = '" + ownerEmpNo + "'", loginConn);
OleDbDataReader reader = getOwnerQuery.ExecuteReader();
while(reader.read())
{
     TextBox1.Text = reader["FieldName"].ToString();
}
reader.Close();
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.