In this article, it talks about the common SqlParameter. I want to use DAAB to do an insert and was trying to do it this way...but didn't know how to set the value to the input parameters for my stored procedure:
I think the above is only for if you want to call a stored proc to get information, not do an insert right? I didn't see a way to set the value
for the parameter such as a textbox value to pass to the stored proc so I assume use some other method in the DAAB 2.0?
Looking at your example, and without seeing the stored proc, I would say that you need to pass in the textbox value for SearchTerm. Also, I don't think ResultCount should be an "in" parameter...
I'v actually figured this out already on my own, thanks though. I already had a textbox and all that. Resultcount is my own param, one of the fields in my DB table. Anyway, I'm closing this.
dba123
Contributor
2726 Points
1364 Posts
Difference between AddInParameter and SqlParameter
Jul 25, 2006 07:22 PM|LINK
In this article, it talks about the common SqlParameter. I want to use DAAB to do an insert and was trying to do it this way...but didn't know how to set the value to the input parameters for my stored procedure:
Database
db = DatabaseFactory.CreateDatabase();DbCommand
dbCommandWrapper = db.GetStoredProcCommand("Search_KeywordSearchLog_I");db.AddInParameter(dbCommandWrapper, "SearchTerm", System.Data.DbType.String, 40);
db.AddInParameter(dbCommandWrapper, "CreateDate", System.Data.DbType.DateTime, DateTime.Now);
db.AddInParameter(dbCommandWrapper, "ResultCount", System.Data.DbType.Int16, 1);
db.ExecuteNonQuery(dbCommandWrapper);
I think the above is only for if you want to call a stored proc to get information, not do an insert right? I didn't see a way to set the value for the parameter such as a textbox value to pass to the stored proc so I assume use some other method in the DAAB 2.0?
Triax
Member
511 Points
100 Posts
Re: Difference between AddInParameter and SqlParameter
Jul 26, 2006 05:01 PM|LINK
Noonan Consulting Inc.
EasyObjects.NET - The O/RM architecture for the Enterprise Library
dba123
Contributor
2726 Points
1364 Posts
Re: Difference between AddInParameter and SqlParameter
Jul 26, 2006 05:21 PM|LINK
I'v actually figured this out already on my own, thanks though. I already had a textbox and all that. Resultcount is my own param, one of the fields in my DB table. Anyway, I'm closing this.
FutureGuru
Member
57 Points
82 Posts
Re: Difference between AddInParameter and SqlParameter
Mar 22, 2007 03:35 PM|LINK