Click here to Skip to main content
16,013,642 members
Home / Discussions / C#
   

C#

 
GeneralTab Control Pin
mathon13-Oct-04 21:59
mathon13-Oct-04 21:59 
GeneralRe: Tab Control Pin
Alex Korchemniy14-Oct-04 9:50
Alex Korchemniy14-Oct-04 9:50 
Generaladding combo box and data picker in DataGrid Pin
shambho13-Oct-04 21:24
shambho13-Oct-04 21:24 
GeneralAltering the word wrap in a multiline text box / rich text box Pin
Jay Shankar13-Oct-04 20:50
Jay Shankar13-Oct-04 20:50 
QuestionDesktop context menu? Pin
ting66813-Oct-04 20:48
ting66813-Oct-04 20:48 
Generalrearange combobox Pin
rolandf6913-Oct-04 20:19
rolandf6913-Oct-04 20:19 
GeneralFile Copy to network share Pin
tmonte13-Oct-04 17:44
tmonte13-Oct-04 17:44 
GeneralUniqueidentifier Pin
pat27088113-Oct-04 12:19
pat27088113-Oct-04 12:19 
Hello,

I want to save the name of the company in the textBox2. The problem which occur is with the JobId. I will get the JobId number from a previous page as a string. Here I have quoted an example JobId. (the JobIds are saved in the database as uniqueidentifier). The Problem occurs in the ExecuteReader. I think it concerns that the parameter @JobId is of type uniqueidentifier and the the quoted jobId here is from type string. So it occurs a Data conversion failed. error.

jobId = "D4DF269F-F9FB-4C88-A005-11C98B38818A";

this.dataSource = "\\Program Files\\MobileHelpDesk.sdf";
this.strConn = "Data Source = " + dataSource;
this.connection = new SqlCeConnection("Data Source = " + dataSource);

SqlCeCommand command = new SqlCeCommand();
command.Connection = connection;

command = connection.CreateCommand();

command.CommandText = "SELECT c.CompanyName, c.ContactLName FROM Client c INNER JOIN JobDescription p ON p.EmailClient = c.Email WHERE p.JobId = ?";
command.Parameters.Add( "@JobId", jobId);

connection.Open();
drdrDB = command.ExecuteReader();

while (drdrDB.Read())
{
textBox2.Text = drdrDB["JobId"].ToString();
}
drdrDB.Close();
connection.Close();

Does anybody know how can I solve this problem or parse the jobId string in the corresponding type?? or is there another error? But the Select String is correct, I tried it in VS.NET.

thx

patrick


GeneralRe: Uniqueidentifier Pin
Colin Angus Mackay13-Oct-04 13:42
Colin Angus Mackay13-Oct-04 13:42 
GeneralRe: Uniqueidentifier Pin
pat27088113-Oct-04 21:57
pat27088113-Oct-04 21:57 
GeneralControlling Video Streaming in a Web App Pin
El Queso13-Oct-04 11:51
El Queso13-Oct-04 11:51 
GeneralRe: Controlling Video Streaming in a Web App Pin
yoaz14-Oct-04 6:58
yoaz14-Oct-04 6:58 
GeneralDynamic property editor - design time Pin
Lech Cieslar13-Oct-04 11:46
Lech Cieslar13-Oct-04 11:46 
GeneralSearching for IO Control Codes Pin
BoxenBiene13-Oct-04 10:53
BoxenBiene13-Oct-04 10:53 
GeneralRe: Searching for IO Control Codes Pin
Dave Kreskowiak14-Oct-04 3:07
mveDave Kreskowiak14-Oct-04 3:07 
GeneralRe: Searching for IO Control Codes Pin
BoxenBiene14-Oct-04 8:04
BoxenBiene14-Oct-04 8:04 
Generalchanging cursor when hover over listview item subitem Pin
vista2713-Oct-04 10:44
vista2713-Oct-04 10:44 
GeneralRe: changing cursor when hover over listview item subitem Pin
MrEyes14-Oct-04 2:13
MrEyes14-Oct-04 2:13 
GeneralTranslating Win32API and their Structs problems Pin
BoxenBiene13-Oct-04 10:42
BoxenBiene13-Oct-04 10:42 
GeneralRe: Translating Win32API and their Structs problems Pin
yoaz14-Oct-04 7:10
yoaz14-Oct-04 7:10 
GeneralRe: Translating Win32API and their Structs problems Pin
BoxenBiene14-Oct-04 8:01
BoxenBiene14-Oct-04 8:01 
GeneralRe: Translating Win32API and their Structs problems Pin
yoaz14-Oct-04 8:41
yoaz14-Oct-04 8:41 
GeneralListView Add Data Pin
mfcuser13-Oct-04 10:06
mfcuser13-Oct-04 10:06 
GeneralRe: ListView Add Data Pin
Anonymous13-Oct-04 10:55
Anonymous13-Oct-04 10:55 
GeneralRe: ListView Add Data Pin
mfcuser13-Oct-04 11:28
mfcuser13-Oct-04 11:28 

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.