473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

INSERT function in ASP.NET

20
hi
i'm using asp.net(vb lamguage),and trying to write an sql statemnet to insert values in my table,i'have tried many ways but no one work as i need tere is alawya an error.i'm also using componentart tools and try to insert values in the table to appear at grid.
here is my last one
cmd.CommandText = "insert into std_t(std_no,std_name)values(@std_no,@std_name)"

can any one help or have another ideas.
thanx lot
Dec 8 '07 #1
2 2354
JamieHowarth0
533 Expert 512MB
Hi zaiena,

Your question is a .NET-specific one and so has been moved to the .NET Forum.

With regard to INSERT statements, I'm a newbie to ASP.NET but I believe that if you use a DataSet and add an INSERT function to the TableAdapter then you can call that from your ASP.NET code (if you're using Visual Web Developer).

Best regards,

medicineworker
Dec 9 '07 #2
jaz215
55
hi
i'm using asp.net(vb lamguage),and trying to write an sql statemnet to insert values in my table,i'have tried many ways but no one work as i need tere is alawya an error.i'm also using componentart tools and try to insert values in the table to appear at grid.
here is my last one
cmd.CommandText = "insert into std_t(std_no,std_name)values(@std_no,@std_name)"

can any one help or have another ideas.
thanx lot
you talked about errors, maybe we could see about your errors and that we can solve it from there :P
could you note what are you using to develop asp so we can better help you..
regarding you query have you tried using:

Expand|Select|Wrap|Line Numbers
  1. comInsert.CommandText = "Insert into [Table] values " & _
  2.                                     "('" & firstvalue & "', " & _
  3.                                     "'" & value2 & "', " & _
  4.                                     "'" & value3 & "', " & _
  5.                                     "'" & value4 & "', " & _
  6.                                     "'" & lastvalue & "')"
  7.  
  8. comInsert.ExecuteNonQuery()
Dec 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: george | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, on an NT box, Active Server pages with Javascript, using ADO objects. ...
8
by: Johannes A. Brunner | last post by:
Got a simple problem. I code some site and because Im a freak I made my own session-handling. When a user open up my site it will check if there is a ssid in the url if not generate one. this will...
2
by: Polyhedron_12 | last post by:
I am having problems calling functions in general in VB. I keep getting alot of errors. Can anybody help me out with this? I put the error message on the same line that it says it is at. I believe...
14
by: Chris Ochs | last post by:
The documentation doesn't have any examples of using an sql language function to do an insert, andI am at loss as to I am doing wrong here. The error I get trying to create the function is: ERROR:...
8
by: Marvin McNett | last post by:
How do I go about ensuring that data is only added to a table through a function? I've tried granting execute persission on the function which inserts data, but can't get it to work unless the...
4
by: neilcancer | last post by:
i wrote a function to insert an elem into a list, but it was wrong,wrong,wrong! and i have no idea about why it was wrong. If anyone know, leave your advice, thank you. #include<stdio.h>...
6
by: flash | last post by:
write a program that manipulates arrays of integers. The main program should call three functions: Insert, Delete, and Search. The Insert function should call a function Sort that sorts the array. ...
6
by: askmatlab | last post by:
Hello all: I would like to insert a number into a linked list in ascending order. Is the following function correct? void insert(Node **node, int v) { Node *tmp = (Node...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
0
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.