Tuesday, February 15, 2011

crystal report bind to database

SqlConnection con = new SqlConnection("database=.;initial catalog=navodya_vidyalya; integrated security=true;");

            con.Open();

            SqlCommand adap = new SqlCommand("show", con);

            adap.CommandType = CommandType.StoredProcedure;

            adap.Parameters.AddWithValue("@name", textBox1.Text);

           SqlDataReader rd= adap.ExecuteReader();

           DataTable dt = new DataTable();

           dt.Load(rd);

No comments :

Post a Comment