First
myCommand.CommandText = String.Format("INSERT INTO PhoneInformation (Guid, DateAdded, TimePutIn, uri) VALUES ('{0}','{1}','{2}', {3})", guid, dateAdded, timePutIn, uri);
Second
myCommand.CommandText = "INSERT INTO PhoneInformation (Guid, DateAdded, TimePutIn, uri) VALUES (@guid, @dateAdded,@timePutIn,@uri";
myCommand.Parameters.Add("@guid", System.Data.SqlDbType.VarChar).Value = guid;
myCommand.Parameters.Add("@dateAdded", System.Data.SqlDbType.DateTime).Value = dateAdded;
myCommand.Parameters.Add("@timePutIn", System.Data.SqlDbType.Int).Value = timePutIn;
myCommand.Parameters.Add("@uri", System.Data.SqlDbType.VarChar).Value = uri;
So far neither have worked and I get a "FaultException was unhandled" but once I remove the uri string from the query it works fine So I believe something in the string is not being escaped right and messing up the query. If anyone can give me any direction on simply getting the ChannelUri to insert you would definitely be helping me overcome a huge problem right now.

New Topic/Question
Reply



MultiQuote



|