Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string st;
- OleDbConnection conn = new OleDbConnection();
- conn.ConnectionString = Connect.GetConnectionString();
- OleDbCommand command = new OleDbCommand();
- command.Connection = conn;
- command.CommandText = "select TypeCode from GateTypes where TypeName=@TypeName";
- command.Parameters.AddWithValue("@TypeName", TypeName);
- conn.Open();
- OleDbDataReader reader = command.ExecuteReader();
- if (reader.Read())
- {
- st=reader["TypeCode"].ToString();
- conn.Close();
- return st;
- }
- else
- {
- conn.Close();
- return "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement