Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...You have made an incredible site which is truly a great help to me in solving problems. A tip of my hat to you!..."

Geography

Where in the world do Tek-Tips members come from?
dushkin (Programmer)
24 Jun 04 18:34
Hi. I tried this in SQL and nobody could figure it out. I am stuck on a sql/logic problem. No matter what i do i get the same error - waiting for another function to complete. the database is working fine and i still get the same error. When i try to print to a messagebox, it breaks at the same point... wherever there is comm.ExecuteScalar(); I have printed the code below. The error message i get next to the first comm.ExecuteScalar is:

"this code has called into another function. when that function is finnished, this is the next statement that will be executed".

here is the code...

CODE


private void bLogin_Click(object sender,System.EventArgs e)
{
        
const string connStr = "data source= FUGUE\\NETSDK;" +
 "Initial Catalog = office_DB;" + "User ID = sa;" +"Password =tomatito";            
//hashPassword = HashString(tbPassword.Text);
SqlConnection conn = new SqlConnection(connStr);
string sql = "SELECT Email_Addr FROM Employees WHERE Email_Addr ='" +cbEmail.Text + "' AND Password ='"+ tbPassword +"'";
SqlCommand comm = new SqlCommand(sql, conn);
conn.Open();
//if there is a match

if(comm.ExecuteScalar() != null)
{

//minimize the signin form        
SignInForm s = new SignInForm();
s.WindowState = System.Windows.Forms.FormWindowState.Minimized;
            
//And close this login form
this.Close();

//And open the SM GUI
Gui gui = new Gui();
gui.Show();
                    
}
            
errorProvider.SetError(bLogin, ErrMsg);
MessageBox.Show("You are not in our database. Try again, register, or cancel.");
                
conn.Close();
conn.Dispose();
        
}
}
 
stefanwagner (Programmer)
25 Jun 04 2:35
did you print your string sql ?

seeking a job as java-programmer in Berlin: http://home.arcor.de/hirnstrom/bewerbung

dushkin (Programmer)
25 Jun 04 8:41
can you tell me how to do that? every time i try to messagebox.show or write to a console it breaks at the same point comm.executescalar. i am not able to see
error output unless i mouse over code during debug.
jfrost10 (Programmer)
25 Jun 04 12:21
Hmmm...maybe try and go

Comm.Connection.open

instead of openting the connection explicitly (not sure if that's it, but worth a try...)

D
stefanwagner (Programmer)
26 Jun 04 21:48

CODE

string sql = "SELECT Email_Addr FROM Employees WHERE Email_Addr ='" +
cbEmail.Text + "' AND Password ='"+ tbPassword +"'";
// here:
System.out.println (sql);
SqlCommand comm = new SqlCommand(sql, conn);

seeking a job as java-programmer in Berlin: http://home.arcor.de/hirnstrom/bewerbung

dushkin (Programmer)
26 Jun 04 22:13
hi. thanks, but all that does is print out the sql line directly above it. the problem i have is with comm.ExecuteScalar... it breaks and says it is waiting for another function to end. I am not sure how to error check that break. thanks again...
0CODE (Programmer)
17 Jul 04 21:23
im using VB.NET 2005 and im getting that too but not as an error, its called "call return" - and when i run my program it goes into the debugger and highlights a line of code green.

if i find out how to fix/or something il post here.
stefanwagner (Programmer)
17 Jul 04 22:48
I asked for the sql-string, because they sometimes don't look as expected.
At least you could try the statement in a sql-box.

In general, that's very much a VB.NET question - isn't it?

seeking a job as java-programmer in Berlin: http://home.arcor.de/hirnstrom/bewerbung

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close