In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the method of parameter transfer in the link database in C # and asp.net, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.
Example analysis
# region Parameter transfer method first / / Parameter setting method (first) / / SqlParameter sp = new SqlParameter ("@ Name", str_Name); / / SqlParameter sp2 = new SqlParameter ("@ Pwd", str_Pwd); / / cmd.Parameters.Add (sp); / / cmd.Parameters.Add (sp2) # endregion// is simple and generally uses the first # region parameter passing the second method (is the first omit to pass variables) cmd.Parameters.Add (new SqlParameter ("@ Name", str_Name)); cmd.Parameters.Add (new SqlParameter ("@ Pwd", str_Pwd)) # third method of endregion#region parameter passing (array passing) / / SqlParameter [] sp = new SqlParameter [] {new SqlParameter ("@ Name", str_Name), new SqlParameter ("@ Pwd", str_Pwd)}; / / cmd.Parameters.AddRange (sp); # fourth method of endregion#region parameter passing (AddWithValue) / / cmd.Parameters.AddWithValue ("@ Name", str_Name); / / cmd.Parameters.AddWithValue ("@ Pwd", str_Pwd) # endregion// large projects generally use the fifth method of # region parameter passing (similar to the first, adding database parameter types) / / SqlParameter sps = new SqlParameter ("@ Name", SqlDbType.NVarChar); / / SqlParameter sps2 = new SqlParameter ("@ Pwd", SqlDbType.NVarChar); / / sps.Value = str_Name; / / sps2.Value = str_Pwd; / / cmd.Parameters.Add (sps) / / cmd.Parameters.Add (sps2); # endregion Thank you for reading this article carefully. I hope the article "what are the parameter transfer methods in the link database in C# and asp.net" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.