Insert into SQL db problem with GUID
I want to add a record to a SQL table but get an error using a guid.
Dim csql as string
csql = "Insert into TestTable (ID, nummer, aantal, eventID, toegevoegd, door, aangepast, aangepastedoor) values(newid(), " & start+i & ", " & t.Text & ", '" & request.querystring("id") & "', '" & Now() & "', '" & session("adminVLALola") & "', NULL, NULL)"
Dim myCommand2 As New SqlCommand(csql, myConnection)
...problem inserting/displaying data from SQL server DB
i'm trying to add a guestbook to my website and i figured the best way would be to add a table in the ASPNETDB membership database and have the info inserted into that table and then called to display. however i can't seem to connect to that database and or table. it's configured correctly in my web.config file because i can create accounts and login to my website fine on the running on the webserver, however i can't seem to insert into the guestbookcomments table i made or anything. my webserver is through Godaddy is that helps. I have removed the passwor...Insert Data into sql DB using VB.net backend
I need too use my VB.net backend to insert data into my database from seveeral controls on the page. I have tried writing some code to do this but i am a beginner, and i am completely stuck.
Heres what i have so far
Dim userid As String = DropDownList2.SelectedValue
Dim username2 As String = DropDownList1.SelectedValue
Dim date2 As String = Calendar1.SelectedDate
Dim invoiceid As Integer = TextBox1.Text
Dim amount As Decimal = TextBox2.Text
Dim conn As String = ConfigurationManager.ConnectionStrings("U...Problem inserting data into SQL Server 2005 DB from WebForm controls
I am having problems running a stored proc from an aspx.cs file. Basically I want to extract data from webForm controls and create a new record in a DB table. I have watched the "Getting Started" videos on thi site, and the only difference between my code and the code of the demonstrator is the connection string. My conn string:- dataSrc.ConnectionString = ConfigurationManager.ConnectionStrings["ProjectTblConnString"].ConnectionString;Demonstrator conn string:- dataSrc.ConnectionString = ConfigurationManager.ConnectionStrings("ProjectTblConnString");When I de...Attach SQL DB to SQL Server 2005 using VB.Net
Is there any way to attach a SQL DB to SQL Server 2005 using VB.Net? If so can you also set security?
Can you rephrase your question? Attach SQL DB from which version of SQL server ? Look up books online for sp_attachdb and sp_detachdb.***********************Dinakar NethiLife is short. Enjoy it.***********************
I have a DB that was created in SQL Server 2005. I have a website that displays data from systems all over the world. Each system sends it's data to it's own DB. The customer can then go to a website and see the data at real time. What ...sql insert problem
heres the error message i got
Server: Msg 128, Level 15, State 1, Line 7
The name 'Admin' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
INSERT INTO Admin (AdminName, AdminPassword, AdminEmail, AdminFullName, AdminLvl) VALUES ("Admin", "Admin", "email@example.com", "Admin Admin", 1)
something wrong with this insert statement, i use it before , it works fine, then i added more stuff to my sql script. and I didn't touch the insert statement. and when i run it ...sql problem insert
Hi I have the following bit of code:What the code is doing is inserting values into a table by selecting them from another table where a room code matches a room code in a sessionhowever the insert is not workingany ideas?cheers SqlCommand cmd2 = new SqlCommand("INSERT INTO room_type_temp (Room_code, Room_description, area, instance_variant, Room_notes, height, spanotes, pladescription, perdescription, floor, walls, ceiling, doorsets, glazing, windows, chano...Problems with Insert SQL
I am executing thsi SQL:
insert top(105) into zikbay_test.dbo.classifieds_categories (parentcategoryid, path, name, numactiveads, createdon, createdby, modifiedon, modifiedby)
select parentcategoryid, path, name, numactiveads, createdon, createdby, modifiedon, modifiedby from zikbay.dbo.classifieds_categories order by createdon desc
But got this error:
Msg 50000, Level 16, State 1, Procedure OnCategoryInsert, Line 9
Only single row inserts are supported
Msg 3609, Level 16, State 1, Line 1
The transaction ended in the trigger. The batch has been aborted.
Any idea? Plea...Problem with SQL Insert
I have this insert command:string command = "Insert into tbl_books (ID, Title, Series, [Last Name - 1], [First Name - 1], " + "[Last Name - 2], [First Name - 2], [Last Name- 3], [First Name - 3], [Last Name - 4], " + "[First Name - 4], [Corporate Author], Edition, Publisher, Copyright, [ISBN Number], " + "[Call Number - Comple...SQL insert problem
I have the following code:
Insert into log (log.memberid, log.bookid, log.reserved)
values(str1, str2, n);
ReturnValue = dw_2.Update( )
and what to insert a row into access database, but it don't return any
error and don't the work, I don't know why, please help me.
First, some assumptions:
1) You have successfully established a connection to your access database
via the SQLCA transaction object
2) dw_2 has a dw object associated with it that includes all fields from the
If these are true, ...INSERT INTO SQL DB
So...I have 3 textboxes and a Submit button and here's what I wrote for the button onclick function in the code behind file:
SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=.\\SQLEXPRESS; initial catalog=ForumDataBase.mdf; Integrated Security=True;User Instance=True"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "INSERT INTO PostTable(ThreadTitle,PostMessage,UserName) values('"+ThreadTextBox.Value+"','"+PostTextBox.Value+"','"+NameTextBox.Value+"')";...Problem with SQL Insert
I'm fairly new to ASP.NET and the majority of this code is modified from the MSDN code, but I need to start somewhere to get my grounding, and there's a surprisingly small selection of sites on Inserting information into tables, while there's a plethora on pulling information. Here's my code.
<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Text"%>
<scr...sql insert problem
The full code is posted below, the insert is near the bottom, Ive tried to
get an insert to work by using the varibale, ive tried it with
'$intasession_id' as document.value.intasession_id and as all the other
items that even look close. Now im getting the following error;
An error has occurred expanding
SQL State 22005
[INTERSOLV][ODBC SQL Server driver][SQL Server]Implicit conversion from
datatype 'VARCHAR' to 'NUMERIC' is not allowed. Use the C
I love the way the e...SQL insert problem
string update;string first = name.Text; ///my textbox
update = "INSERT INTO work (ime) VALUES ('first') ";SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=localhost\SQLEXPRESS;" +"Initial Catalog=master;Integrated Security=SSPI";
SqlCommand cmd = new SqlCommand(update,con);
insert work perfect but I have in my database first('first') but not value, if I put something in my textbox every time I get first ...I do...