<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%
SqlConnection objCon;
SqlCommand objCmd;
objCon = new SqlConnection();
objCmd = new SqlCommand();
string strCon = "server=localhost;database=dotnet;user id=dotnet;password=dotnet";
objCon.ConnectionString = strCon;
objCon.Open();
objCmd.Connection = objCon;
string strSql = "Insert CSharpTest" + " " +
"Values('홍길동')";
objCmd.CommandText = strSql;
objCmd.CommandType = CommandType.Text;
int intNum;
intNum = objCmd.ExecuteNonQuery();
objCon.Close();
Response.Write(intNum + "개의 데이터가 입력되었습니다.");
%>