2012-01-14 51 views
-1

我是一名初學者程序員,嘗試學習編程。 我只是想編寫儘可能簡單的代碼,以便從下面的html示例中向SQL Server添加一些數據,以便了解流程。如何使用asp.net添加到SQL Server?

任何人都可以通過使用asp.net教我簡單的代碼嗎?

<html> 
<head> 
<title> user register practice </title> 
</head> 
<body> 
<h1>User Register</h1> 

ID: <input type = "text"><br/> 
Password: <input type = "password"><br/> 
name: <input type = "text"><br/> 

<input type ="submit"> 
<input type ="reset"> 

</body> 
</html> 
+0

它是如何**不工作** ??這只是不添加任何數據?它給你一個錯誤?如果是這樣的話:**錯誤是什麼** – 2012-01-14 08:57:15

回答

1

您的查詢有語法錯誤,應該是INSERT INTO tablename (fields) VALUES (values)。你錯過了into

+1

我相信'INTO'是可選的.....請參閱[MSDN docs on INSERT](http://msdn.microsoft.com/zh-cn/library/ms174335.aspx) – 2012-01-14 08:58:22

相關問題