.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2003, 02:47 AM
Volfram Volfram is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 Volfram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem making a Insert

Hi everyone
I have a problem I have been wondering about some time now ...

Im making a simpel convert program that takes a '\t' or ';' delimited text, chopps it up and entere it undre the right field in a windows 2000 sql server.

First I wonderd it the sql strings had a syntax fault, but then I tryed to execute them in excel (get external data -> starts microsoft querry ) on the same machine , and it works fine.
So I then suspected that fore some reason i didnt have the same rihgts in my .NET enviroment as I had in microsoft querry... strange.

public void test()
{
try
{
SqlConnection Conn = new SqlConnection("user id=USER; password=PASSW; initial catalog=db_test; integrated security=SSPI;persist security info=False;server=SERVER1;workstation id=XXXXX-volfram;packet size=4096;");
try
{
con.Open();
statusBar.Text="Sucessfully conected to Jeeves";
}
catch(Exception e)
{
statusBar.Text="ERROR -> NOT CONECTED TO JEEVES:\t"+ e.GetType();
}

SqlCommand command = new SqlCommand();
// @@ this one works @@
//command.CommandText = "select artnr from op";

// @@ This one donīt work @@
command.CommandText = "insert into OP (artnr,opnr,opben,prodGr) values ('10002',13,'CadLIsta',0)";

command.Connection=Conn;
command.ExecuteNonQuery();
statusBar.Text="Inside test Function";
Conn.Close();
}
catch(Exception e)
{
statusBar.Text="\r\n Error: " + e.GetType() + " While writhing to database";
textBox1.Text +="\r\n Error: " + e.GetType() + " While writhing to database";
}

}

Reply With Quote
  #2  
Old October 14th, 2003, 03:21 AM
Volfram Volfram is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 Volfram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
forgot to paste the error I get

error: system.data.sqlclient.sqlexception while writhing to database.


Regards
Volfram

Reply With Quote
  #3  
Old October 14th, 2003, 03:29 AM
Volfram Volfram is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 Volfram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
AHHH DAMIT ....sorry .... got it
string myConnString ="user id=USER; password=PASSW; initial catalog=db_test; integrated security=SSPI;persist security info=False;server=SERVER1;workstation id=XXXXX-Voflram;packet size=4096";

If I removed integrated security=SSPI it worked

Have a nice day
Volfram

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Problem making a Insert


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT