There's more than one way to do it, and there are questions that have to be answered first. What kind of database is it? Do you already have a connection? Are you running a stored procedure or an ad hoc query? Does the query need any input? Are you doing any other work? The process may need to be run as a transaction.
And more importantly, what have you tried already that didn't work?
i want my username and the region to be fetched from the table and display in every page..
i have done this in web application...
hope tht u can get me de code..
i have done this with MY-SQL
con=new SqlConnection("server=pstlcorpserv;database=mis;user Id=sa;password=sqlserver12#");
adap = new SqlDataAdapter("select region from users where username like @r", con);
set = new DataSet();
adap.SelectCommand.Parameters.Value = Label2.Text+"%";
Label2.Text = set.Tables.Columns.ToString();