This article mainly introduces how to compile the sqlhlper class example by yourself. if you want to compile SqlHelper, you can refer to it for your reference.
Using System; using System. collections. generic; using System. linq; using System. text; using System. windows; using System. windows. controls; using System. windows. data; using System. windows. documents; using System. windows. input; using System. windows. media; using System. windows. media. imaging; using System. windows. navigation; using System. windows. shapes; using System. data; using System. data. sqlClient; namespace SqlHelper {////// Interaction logic of Window1.xaml ///Public partial class Window1: Window {public Window1 () {InitializeComponent ();} // only the SQL private void btnds_Click (object sender, RoutedEventArgs e) with few query results is executed) {SqlHelper. executeNonQurey ("insert into T_Student (Name, Age) values ('Zhang San', 55)", new SqlParameter [0]); MessageBox. show ("added successfully");} private void btnDataSet_Click (object sender, RoutedEventArgs e) {DataSet ds = SqlHelper. executeDataSet ("select * from T_Student where hobbit = '@ Hobbit'", new SqlParameter [] {new SqlParameter ("' @ hobbit '", "hahaha ")}); foreach (DataRow row in ds. tables [0]. rows) {string name = (string) row ["Name"]; MessageBox. show (name );}}}}
For more articles about sqlhelper examples, refer to PHP!