In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Data query: private void FullTab () {SqlConnection con1 = new SqlConnection (); / / create database link try {String con = "server=.;database=common_wjdl;uid=sa;pwd=db2008mima"; / / define database connection information con1.ConnectionString = con; con1.Open () / / Open the database String sql = "select * from Fileuploaded"; / / create a statement to query all data SqlDataAdapter ada1 = new SqlDataAdapter (sql, con); / / SqlDataAdapter objects. Used to populate the DataSet (dataset). DataSet myset = new DataSet (); SqlCommand cmd = con1.CreateCommand (); / / create database command cmd.CommandText = sql; SqlDataReader reader = cmd.ExecuteReader (); / / read the data stream from the database and store it in reader} catch (SqlException ee1) {Console.WriteLine (ee1.Message) / / print exception message} catch (IndexOutOfRangeException ee2) {Console.WriteLine (ee2.Message); / / print exception message}} data insertion: (about the same, just modify the SQL statement) String con = "server=.;database=common_wjdl;uid=sa;pwd=db2008mima" / / define database connection information con1.ConnectionString = con; con1.Open (); / / Open database String sql = "insert into Fileuploaded (FileID,FileName,FilePath,QRCodePath,FileSuffix) Values ('" + fileNameSave+ "','" + fileName+ "','" + filePath+ "','" + filePath+ "','" + fileSuffix+ "')" / / create statement to insert data into the database SqlCommand cmd = con1.CreateCommand (); / / create database command cmd.CommandText = sql; cmd.ExecuteNonQuery ()
Attachment: http://down.51cto.com/data/2366720
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.