Info

zhaozj2021-02-16  50

String constr = "server =; uid =; pwd =; initial catalog = test;"

SqlConnection myconn = new sqlconnection (constr);

Myconn.open ();

String constr = "Server = kkk; integrated security = sspi; initial catalog = networkinfo;";

SqlConnection myconn = new sqlconnection (constr);

Myconn.open ();

String mycommand = "INSERT INTO TEST (MYNAME) VALUES (@A)";

SQLCommand mycomm = new sqlcommand (mycommand, myconn);

Mycomm.Parameters.Add (New Sqlparameter ("@ a", sqldbtype.nvarchar, 10));

Mycomm.Parameters ["@ a"]. Value = "Must OK!";

Try

{

Mycomm.executenonquery ();

}

Catch

{

Test.text = "OH ~~~~ Error!";

}

ID = "" Runat = "server" Display = "none" errorMessage = "" ControlToValidate = ">>>

ErrorMessage = "The password input two times is inconsistent" ControlToValidate = "PWD1"

EnableClientScript = "false" TYPE = "string" ControlToCompare = "pwd2" operator = "equal">

Type conversion

INT.PARSE (YourString);

Convert.TOINT16 (STR);

Verification type

"^ // D $" // Non-negative integer (positive integer 0)

"^ [0-9] * [1-9] [0-9] * $" // positive integer

"^ ((- // d ) | (0 )) $" // Non-integer (negative integer 0)

"^ - [0-9] * [1-9] [0-9] * $" // negative

"^ -? // D $" // integer

"^ [0-9] / d * [.] / D * $" // Verify integers, decimal, Bitmap bmp = new bitmap (100, 50);

Graphics g = graphics.FromImage (bmp);

g.smoothingmode = smoothingmode.antialias;

g.clear (color.lightgray);

g.drawstring (new random (). Next (). Tostring (), New Font ("Araial", 12),

New solidbrush (color.red), New Rectangle (0, 0, 100, 50), StringFormat.GenericDefault);

bmp.save (response.outputstream, imageformat.jpeg);

g.dispose ();

bmp.dispose ();

Response.end ();

转载请注明原文地址:https://www.9cbs.com/read-15017.html

New Post(0)