Inserting into SQL Server

V

VJ

This is the first time I've tried this...
I've got this syntax:

void Page_Load(Object src, EventArgs E) {
string connectionStr =
@"server=111.111.111.111;uid=DDATA/web;pwd=web;trusted_connection=true;d
atabase=events";
string insertQuery = "Insert into Events VALUES " +
"('"+Session["Name"]+"', '"+Session["Phones"]+"')";
SqlConnection connectObj = new SqlConnection(connectionStr);
SqlCommand commandObj = new SqlCommand(insertQuery, connectObj);

commandObj.Connection.Open();
commandObj.ExecuteNonQuery();
commandObj.Connection.Close();
}

The error message I get is this...
Login failed for user '(null)'

I have two application servers DDATA (111.111.111.111) AND DWEB on the
same DOMAIN...
I'm trying to use an insert statement (confirm.aspx) on DWEB into a sql
server DDATA.
 
P

Paul Clement

¤ This is the first time I've tried this...
¤ I've got this syntax:
¤
¤ void Page_Load(Object src, EventArgs E) {
¤ string connectionStr =
¤ @"server=111.111.111.111;uid=DDATA/web;pwd=web;trusted_connection=true;d
¤ atabase=events";
¤ string insertQuery = "Insert into Events VALUES " +
¤ "('"+Session["Name"]+"', '"+Session["Phones"]+"')";
¤ SqlConnection connectObj = new SqlConnection(connectionStr);
¤ SqlCommand commandObj = new SqlCommand(insertQuery, connectObj);
¤
¤ commandObj.Connection.Open();
¤ commandObj.ExecuteNonQuery();
¤ commandObj.Connection.Close();
¤ }
¤
¤ The error message I get is this...
¤ Login failed for user '(null)'
¤
¤ I have two application servers DDATA (111.111.111.111) AND DWEB on the
¤ same DOMAIN...
¤ I'm trying to use an insert statement (confirm.aspx) on DWEB into a sql
¤ server DDATA.

See if the following helps:

http://geekswithblogs.net/ranganh/archive/2005/05/25/40489.aspx


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,833
Latest member
BettyeMacf

Latest Threads

Top