Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 WHERE

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2010-08-05 : 12:45:14
How do I define string?

string strUser = UserId

WHERE tbl_Payments.UserId = tbl_PaymentDetails.UserId = strUser.

Please help.
thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-05 : 12:46:30
Your question is not clear.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2010-08-05 : 13:00:10
quote:
Originally posted by programer

How do I define string?

string strUser = UserId

WHERE tbl_Payments.UserId = tbl_PaymentDetails.UserId = strUser.

Please help.
thanks.



1st Users:

The first table I've UserId = 4w40208488443283 Primarykey
In the other tables I've UserId = 4w40208488443283 Primarykey

2nd Users:

The first table I've UserId = 4443243243432rwr Primarykey
In the other tables I've UserId = 4443243243432rwr Primarykey

How to display data according to login?

thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-05 : 13:08:48
I still don't understand what you are asking.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2010-08-05 : 13:16:24
quote:
Originally posted by tkizer

I still don't understand what you are asking.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Here is a problem:
WHERE tbl_Payments.UserId = '" + strUserId + "' and tbl_PaymentsDetails.UserId = '" + strUserId + "'


Error:
The multi-part identifier "tbl_PaymentsDetails.UserId" could not be bound.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The multi-part identifier "tbl_PaymentsDetails.UserId" could not be bound.


Please help!
thanks
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2010-08-05 : 13:17:27
quote:
Originally posted by programer

quote:
Originally posted by tkizer

I still don't understand what you are asking.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Here is a problem:
WHERE tbl_Payments.UserId = '" + strUserId + "' and tbl_PaymentsDetails.UserId = '" + strUserId + "'


Error:
The multi-part identifier "tbl_PaymentsDetails.UserId" could not be bound.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The multi-part identifier "tbl_PaymentsDetails.UserId" could not be bound.


Please help!
thanks



resolved my problem: PaymentsDetails.UserId
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-05 : 13:23:48
Next time, please be way more clear on your issue. We can't read your mind nor see your computer. Post errors and all code.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -