Sql Server 2008 with textbox
**Hi, I tried to insert into DB using textbox in a form using vb by visual studio 2010 but its always catch an error
[Cannot open database "4" requested by the login. The login failed.
Login failed for user 'sa']
i tried to get a solution for this error
this the code i used**
Imports System.Data
Imports System.Data.SqlClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconn As SqlConnection
Dim cmd As SqlCommand
Dim sqlString, Asd, Lays As String
Asd = ATextBox.Text
Lays = BTextBox.Text
myconn = New SqlConnection("server=localhost;" & "Initial Catalog=4;" & "User Id=sa;" & "Password=123;")
myconn.Open()
sqlString = "INSERT INTO Table1 (A , B) VALUES ('" + Asd + "','" + Lays + "') "
cmd = New SqlCommand(sqlString, myconn)
cmd.ExecuteNonQuery()
myconn.Close()
End Sub
View Answers
Related Tutorials/Questions & Answers:
Sql Server 2008 with textboxSql Server 2008 with textbox **Hi, I tried to insert into DB using
textbox in a form using vb by visual studio 2010 but its always catch an error...
myconn = New SqlConnection("
server=localhost;" & "Initial Catalog=4
SQL SERVER 2008SQL SERVER 2008 when i am fill the all fields in the form.but when i am retrive from the database it shows only firstname,age,address.remaining fields was shows as null.and it shows the gender as the on.i can't understand what
Advertisements
SQL ServerSQL Server Hii,
What is
SQL Server ?
hello,ADS_TO_REPLACE_1
SQL Server is a DBMS system provided by Microsoft
sql server - SQLsql server How many no of tables can be joined in same
sql server Sql Server - SQLsql server trigger example Can any one tell me the live example of triggers in
SQL Server? if u click pistal trigger ,it auotmatically shoot bullet it's like newtons 3rd law (every action s having an equal reaction
date problem in sql server - SQLdate problem in
sql server select count(*) from xxxx_tbl where emplid="+emplid+" and work_dt=#"+work_date+"#"; work_date is in string ,Backend is
sql server 2000.i am getting the date problem when using in jsp page.
XML in SQL ServerXML in
SQL Server Hi.....
please anyone tell me about
What is the purpose of FOR XML in
SQL Server?ADS_TO_REPLACE_1
Thanks
Sql Server like with Sql Server like with SELECT username FROM login WHERE CONTAINS(RelatedWords,'""Insurance"""');
How can we handle this ,throwing error like
Syntax error near 'Insurance' in the full-text search condition '""Insurance
jsp sql server 2005 connectivityjsp
sql server 2005 connectivity your jsp mysql tutorial is very help full.Please tell me how to connect jsp with
SQL server 2005
jdbc odbc sql server exceptionjdbc odbc
sql server exception Hi,
I am trying to use
sql server with java jdbc odbc but I am getting this exception
java.sql.SQLException: [Microsoft][
SQL Server Native Client 10.0][
SQL Server]Incorrect syntax near '@P1
Java to SQL Server ConnectivityJava to
SQL Server Connectivity Hi, heres my code
private void bookedButton()
{
try
{
Class.forName... with
sql server connectivity at the background to save the data.
Now, after
Data Conversion In Sql Server 2005Data Conversion In
Sql Server 2005 Hi
I am working vb.net &
sql server 2005 database. I am storing date (MM/DD/YYYY) format. now I have problem in
sql date conversion (DD/MM/YYYY). Can you help how to convert date
Dynamically Update textbox from databaseDynamically Update
textbox from database I have a database as shown below.(database created using
SQL Server 2005)
name : george,simon
address... with two text boxes. if I type something in one
textbox, the corresponding value
SQL Server Training
SQL Server Training
Microsoft's product
SQL Server is a relational database management system (RDBMS....
This
SQL Server training course will train you everything like installing
SQL SQLSQL what data type we use for the uploading the video and image files in MySQL
server 2008 Database connection sql server 2005 - JDBCDatabase connection
sql server 2005 Hi all i am developing an application in struts and i need to connect database for that application using
sql server 2005.. can anyone tell me how to make database connection ..plz help me
SQL Server row comparison using two tablesSQL Server row comparison using two tables insertion process are completed in table1.string comparison using table2 to table1 if any changes in these tables and then upadated
java and sql server NOT Mysql - JSP-Servletjava and
sql server NOT Mysql Hi guys.
Thank you all for the various helps you render to everyone. Please the question I asked the last time... image from MS
SQL server NOT MySQL. Or is it not possible to do it in MS
SQL server Java servlet with jsp on sql serverJava servlet with jsp on
sql server How to delete a user by an admin with check box in Java Servlet with jsp on
Sql Server?
Here is a jsp example that can delete the multiple record from the database by selecting
Online exam using c# and SQL serverOnline exam using c# and
SQL server hello, i'm making the (window based)online examination system using C#.net and
SQL SERVER. my database is stored on
server. my question is: if during the examination
server gets failed
How to read textfile and create SQL server table ?How to read textfile and create
SQL server table ? hi sir, your site... trying to read textfile and create table in
sql server but it gives error.../questions/16415498/creating-a-table-in-
sql-database-by-reading-textfile-in-java
create a xml from sql server 2005 - XMLcreate a xml from
sql server 2005 hello Dear,
i want to know how we create a xml file which retrieve data from
Sql server 2005 using java.
i am briefing my problem as follows.
let i have a table in
sql server 2005
Error while SQL Server connection to JavaError while
SQL Server connection to Java import java.sql.*;
public...");
con=DriverManager.getConnection("jdbc:odbc:
SQL_
SERVER;user=DTHOTA;password...("password", " ");
con=DriverManager.getConnection("jdbc:odbc:
SQL_
SERVER", prop
Error while SQL Server connection to JavaError while
SQL Server connection to Java import java.sql.*;
public...");
con=DriverManager.getConnection("jdbc:odbc:
SQL_
SERVER;user=DTHOTA;password...("password", " ");
con=DriverManager.getConnection("jdbc:odbc:
SQL_
SERVER", prop