| | |
Insert into sql database
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
Hi guys,
This is my first post here. Actually wanted to insert record into an sql database (using sql server 2000 and visual studio 2000)
I'm using a dataview to see if the user already exists. This, i've been able to retrieve and it works.
Now if the user does not exist, then i add the new user using parameter passing.
I'm getting an error in terms of id cannot be null for my user_id. Doesn't it increment by itself? I'm not using stored procedures.
Is there a way to do this (and without stored procedures)?
Thanks for a reply
Dany
This is my first post here. Actually wanted to insert record into an sql database (using sql server 2000 and visual studio 2000)
I'm using a dataview to see if the user already exists. This, i've been able to retrieve and it works.
Now if the user does not exist, then i add the new user using parameter passing.
ASP.NET Syntax (Toggle Plain Text)
strInsert = "Insert INTO tbl_user(username,password,firstname,lastname,email,status,dateRegistered,sex,type_id,school_id)Values(@username,@password,@firstname,@lastname,@email,@status,@dateRegistered,@sex,@type_id,@school_id)" cmdInsertUser = New SqlCommand(strInsert, sqlConn) cmdInsertUser.Parameters.Add("@username", txtUsername.Text.ToLower) ...and so on cmdInsertUser.ExecuteNonQuery()
Is there a way to do this (and without stored procedures)?
Thanks for a reply
Dany
Last edited by requiem2; Oct 24th, 2006 at 11:36 am.
![]() |
Similar Threads
- Insert Dataset into SQL Database. (VB.NET)
- insert multiple rows in database (MS SQL)
- Problem Inserting into SQL database on server (ASP.NET)
- Beginner: Insert, Update, Delete & Search records from/to sql database (ASP.NET)
- Help with Roles Stored in SQL database (ASP.NET)
- Unable to insert data into SQL Database (ASP)
- Snyc'n Local SQL database online (MS SQL)
Other Threads in the ASP.NET Forum
- Previous Thread: bookmark a page
- Next Thread: DropDownList
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal formview gridview gudi iis javascript list listbox menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview unauthorized validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





