how do i insert records in db on asp .net using visual studio 2008?

Willmer

New member
ok so far this is my problem: I am building a SIMPLE insert record page on ASP.
I have already a db with only one table with only two fields id and name. what I want is a simple webform where I can insert data... but I am restricted from using any html code or whatsoever but the *.aspx.vb scripts. I just want the code.. how would you do? oh and btw please dont refer another tutorials webpages cuz I've already searched and they just explain it quickly
ok thanks but this is what I have in code:

Imports System.Data
Imports System.Data.OleDb

**button code
Dim ciudadcodigo As String
Dim ciudadnombre As String

ciudadcodigo = txciudadcodigo.ToString()
ciudadnombre = txciudadnombre.ToString()

Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Willmer Barahona\Mis documentos\Visual Studio 2008\WebSites\WebSite1\App_Data\db1.mdf")
Dim SQL As String
SQL = "Insert into ciudad (ciudadid, ciudadnombre) values ('" & ciudadcodigo & "', '" & ciudadnombre & "')"
Dim objCmd As New OleDbCommand(SQL, conn)
conn.Open()

btw im latin so the fields on the table are in spanish nevermind, I do have two textboxes from wich the user will insert data and the button executes the sql commands, but now it pops an error says: Couln't use "; the file is already on use
WTH? thats why I hate VS and so I love Genexus... can you tell me whats wrong? damn Im sick of this! :S
 
create sql datasource
create listview an use listview to create form
(config is a bit tricky but once mastered listview control can display edit insert an delete data)
(also cuz not default displayed in a table can be configured to display in most any way removing the need for gridviews an other controls of that nature)
 
create sql datasource
create listview an use listview to create form
(config is a bit tricky but once mastered listview control can display edit insert an delete data)
(also cuz not default displayed in a table can be configured to display in most any way removing the need for gridviews an other controls of that nature)
 
Back
Top