<link href="http://alexgorbatchev.com/pub/sh/2.0.320/styles/shCore.css" rel="stylesheet" type="text/css"></link><br />
<link href="http://alexgorbatchev.com/pub/sh/2.0.320/styles/shThemeDefault.css" id="shTheme" rel="stylesheet" type="text/css"></link><br />
<script src="http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shCore.js" type="text/javascript">
</script><br />
<script src="http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shLegacy.js" type="text/javascript">
</script><br />
<script src="http://alexgorbatchev.com/pub/sh/2.0.320/scripts/shBrushJava.js" type="text/javascript">
</script><br />
<script type="text/javascript">
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.ClipboardSwf = 'http://http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script><br />
<div style="color: black;">
<pre class="brush: java">
String strSQL = " INSERT INTO TABLENAME (SCHEMA, SCHEMA, SCHEMA) VALUES (VALUES, VALUES, VALUES) ";
SqlConnection sqlConn = new System.Data.SqlClient.SqlConnection("Data Source=IP;User Id=ID; Password=PASSWORD; Initial Catalog=DBNAME");
sqlConn.Open();
SqlCommand sqlcommand = new SqlCommand(strSQL, sqlConn);
sqlcommand.ExecuteNonQuery();
sqlConn.Close();
</pre>
<br />
<br />
<br />
<br /></div>
------------------------------呈現如下效果------------------------------
1 | String strSQL = " INSERT INTO TABLENAME (SCHEMA, SCHEMA, SCHEMA) VALUES (VALUES, VALUES, VALUES) " ; |
2 | SqlConnection sqlConn = new System.Data.SqlClient.SqlConnection( "Data Source=IP;User Id=ID; Password=PASSWORD; Initial Catalog=DBNAME" ); |
3 | sqlConn.Open(); |
4 | SqlCommand sqlcommand = new SqlCommand(strSQL, sqlConn); |
5 | sqlcommand.ExecuteNonQuery(); |
6 | sqlConn.Close(); |
沒有留言:
張貼留言