Compiling sqlhelper class example

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.