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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-12-21 : 08:03:56
|
| Rolf writes "Hey,I've a problem with a Stored Procedure:------------------------------------ALTER PROCEDURE dbo.Number ( @parameter1 int = 0 )ASSELECT *FROM TableWHERE Number = @parameter1 /* SET NOCOUNT ON */ RETURN------------------------------------In my C++ class I call this Stored Procedure by:------------------------------------CString number = L"5";CRecordset record(&database);record.Open(CRecordset::dynamic,_T("{CALL Number(" + number + L")}"),CRecordset::readOnly);------------------------------------The problem is that 'number' isn't a CString but a integer. (int number = 5;) It's not allowed to change the integer into CString. How can I bind the integer with the stored procedure?Thnx,Rolf" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-21 : 08:39:50
|
| You concatenate the C++ string with something likerecord.Open(CRecordset::dynamic,_T("{CALL Number(" + number.tostring() + L")}"),CRecordset::readOnly);Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|