Click here to Skip to main content
15,891,136 members

Comments by Mike988 (Top 34 by date)

Mike988 11-Oct-12 14:40pm View    
Thank you
Mike988 5-Sep-12 13:06pm View    
Thank you so much. it works.
Thanks again
Mike988 4-Sep-12 21:44pm View    
it doesn't matter because it's for school and all free
Mike988 4-Sep-12 21:40pm View    
I have learned both. I don't have much experiences with php but I studied asp.net more
Mike988 4-Apr-12 14:34pm View    
it's first time i use classes in asp.net
my code work with this code without classes.but the teacher want to use classes
I have trouble how to use the class and call it from my entire site , instead of my old code.
SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyLocal"].ConnectionString);

//Make the connection
Conn.Open();

//Define you query
string sql = "SELECT * FROM Customer Order by LastName, FirstName";

//Declare a SQL Adapter
SqlDataAdapter da = new SqlDataAdapter(sql, Conn);

//Declare a DataTable
DataTable dt = new DataTable();

//Populate the DataTable
da.Fill(dt);

//Bind the Listview
lv.DataSource = dt;
lv.DataBind();

dt.Dispose();
da.Dispose();
Conn.Close();