Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
AnswerRe: Web service Pin
Dave Kreskowiak30-May-09 18:42
mveDave Kreskowiak30-May-09 18:42 
JokeRe: Web service Pin
Manas Bhardwaj30-May-09 20:13
professionalManas Bhardwaj30-May-09 20:13 
QuestionOne apps causes another app to crash.. [modified] Pin
Jonathan Tripathy30-May-09 11:28
Jonathan Tripathy30-May-09 11:28 
AnswerRe: One apps causes another app to crash.. Pin
Luc Pattyn30-May-09 15:22
sitebuilderLuc Pattyn30-May-09 15:22 
GeneralRe: One apps causes another app to crash.. Pin
Jonathan Tripathy30-May-09 23:32
Jonathan Tripathy30-May-09 23:32 
QuestionVehicle Lane Tracking Algorithm Pin
sebogawa30-May-09 9:44
sebogawa30-May-09 9:44 
AnswerRe: Vehicle Lane Tracking Algorithm Pin
Uffe Rask30-May-09 10:52
Uffe Rask30-May-09 10:52 
AnswerRe: Vehicle Lane Tracking Algorithm Pin
Henry Minute30-May-09 11:01
Henry Minute30-May-09 11:01 
QuestionRe: Vehicle Lane Tracking Algorithm Pin
sebogawa30-May-09 11:11
sebogawa30-May-09 11:11 
AnswerRe: Vehicle Lane Tracking Algorithm Pin
Henry Minute30-May-09 11:28
Henry Minute30-May-09 11:28 
GeneralRe: Vehicle Lane Tracking Algorithm Pin
sebogawa30-May-09 11:33
sebogawa30-May-09 11:33 
GeneralRe: Vehicle Lane Tracking Algorithm Pin
Henry Minute30-May-09 11:53
Henry Minute30-May-09 11:53 
QuestionAdding an event to a dynamically created Button Pin
Douglas Kirk30-May-09 8:08
Douglas Kirk30-May-09 8:08 
AnswerRe: Adding an event to a dynamically created Button Pin
Luc Pattyn30-May-09 8:15
sitebuilderLuc Pattyn30-May-09 8:15 
QuestionSQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 4:09
bigjoe11a30-May-09 4:09 
AnswerRe: SQL Server 2008 in C# Console Appications Pin
Mbah Dhaim30-May-09 5:17
Mbah Dhaim30-May-09 5:17 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 5:35
bigjoe11a30-May-09 5:35 
AnswerRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 7:48
Henry Minute30-May-09 7:48 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 8:17
bigjoe11a30-May-09 8:17 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 8:33
bigjoe11a30-May-09 8:33 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 8:59
Henry Minute30-May-09 8:59 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 9:08
bigjoe11a30-May-09 9:08 
well I'm getting some errors on some of the lines. So I can't compile yet.
I do know that some of of it is missing. My code is below

string UserConnection = Properties.Settings.Default.UsersConnectionString;
SqlConnection MyConnection = new SqlConnection(UserConnection);

String MyString = @"INSERT INTO UserData (Name, telnetaddr) VALUES('" + addr.name.ToString().TRIM() + "', '" + addr.telnetaddr.ToString().Trim() + "')";

SqlCommand command = new SqlCommand(MyString, MyConnection);
//command.Parameters.Add("@ID", SqlDbType.Int);
//command.Parameters["@ID"].Value = ID;
command.Parameters.Add("@Name", SqlDbType.Text);
command.Parameters["@Name"].Value = addr.name;
command.Parameters.Add("@telnetaddr", SqlDbType.Text);
command.Parameters["@telnetaddr"].Value = addr.telnetaddr;

// Use AddWithValue to assign Demographics.
// SQL Server will implicitly convert strings into XML.
command.Parameters.AddWithValue(commandText, );

try
{
MyConnection.Open();
Int32 rowsAffected = command.ExecuteNonQuery();
Console.WriteLine("RowsAffected: {0}", rowsAffected);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

Error 1 Argument missing C:\Users\Joe\Documents\Visual Studio 2008\Projects\MyDoor\Program.cs 245 66 MyDoor

Error 2 'string' does not contain a definition for 'TRIM' and no extension method 'TRIM' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) C:\Users\Joe\Documents\Visual Studio 2008\Projects\MyDoor\Program.cs 233 114 MyDoor

Error 3 The name 'commandText' does not exist in the current context C:\Users\Joe\Documents\Visual Studio 2008\Projects\MyDoor\Program.cs 245 53 MyDoor

What I should have ask if some one could type out the full code So I know I get every thing right.
GeneralRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 9:14
Henry Minute30-May-09 9:14 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
Henry Minute30-May-09 9:22
Henry Minute30-May-09 9:22 
GeneralRe: SQL Server 2008 in C# Console Appications Pin
bigjoe11a30-May-09 9:59
bigjoe11a30-May-09 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.