By Doug Zapp - 12/19/2008
Hi,
I'm in the process of determining which data update method I'd like to utilize, and have come across a little confusion. I've set up a table, and have a select, insert and update stored procedure (labelled like tablename_Insert as per recommendations). I have a business object which connects to said table. I've put the BO onto a form, and have a save function on the form. I set the BO property InsertUsingStoredProcedure to true. When I perform a save, the system reports an error with the message that it cannot locate the stored procedure named dbo.tablename_Insert.
However, if I qualify the BO on the form by setting the InsertStoredProcedureName to databasename.dbo.tablename_Insert, the save functionality works.
Any ideas?
Thanks,
Doug.
|
By Peter Jones - 12/19/2008
Hi Doug,Just a stab in the dark - I would be double checking the BO Mapper to make sure you have an Initial Catalog in the connection string. Cheers, Peter
|
By Trent L. Taylor - 12/19/2008
I would double check your names. The default naming schema expected (if not provided) is like you mentioned, TableName_Update, for example. So if this is not being found, then I would wonder if your schema name or initial catalog (like Peter mentioned) does not line up with the sproc name. If you want to see this in action, I would recommend letting the DDT create one of these for you and then you would see exactly how it is defined.
|
By Doug Zapp - 1/2/2009
Both my procedure naming convention and the initial catalog appear to be correct. Attached is my Business Object Property dialog. I have attempted selecting as source both the SQL Server and Database Deployment Toolkit options.
I have also attempted manually added the connection string. Are there any differences in using SQL Server Express?
Thanks.
Doug.
|
By Edhy Rijo - 1/2/2009
Doug, Like Peter and Trent suggest, double check the connection string in the BOM Project Properties form, when you select your SQLExpress server, the connection string should have the "Initial Catalog=" like the sample below of one of my projects: Data Source=localhost;Initial Catalog=TranSure_Data;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True
|
By Doug Zapp - 1/2/2009
I've got a really naive question, but being a newbie to SF, I hope I'm forgiven. What's worse, I know exactly what you are talking about in the Connection string.
My issue is how do I see the connection string in the Business Object Mapper? I can see that the structure has a selected Class, Database, Table and Schema. But I see nowhere that I can view the connection string, other than the Connection String Override.
Help?
|
By Edhy Rijo - 1/2/2009
Hi Doug,Nothing to worry about being newbie To see the connection string do the following: - Open the BOM
- Select your BO Library Project
- Click the "Modify Project Properties" link on the right pane
- You will have the Project Properties form which has the SQL Server Connection String as below:
|
By Doug Zapp - 1/5/2009
OK. Thanks.
My connection string is as follows:
Data Source="my computer name"\SQLEXPRESS;Initial Catalog=TPCShip;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True
The only difference between the example and mine is that I have a "named" Data Source, and my Default Structure Settings is set to SQL Server rather than Database Deployment Toolkit. My Initial Catalog is set (which I presume is correct, since that is the database I want to hit).
Is there anything else I should be looking for?
|
By Doug Zapp - 1/6/2009
I just noticed something else that may be causing my issues. I just created a new BO, and upon specifying the BO properties, I noticed that my previous BO's did not have a Profile specified.
What is this for and if this is in fact an issue, how do I get my original BO's to obtain the Profile?
Thanks,
Doug.
|
By Trent L. Taylor - 1/6/2009
I assume that you are referring to the BO Mapper. In which case, this is remember by project. So if you have BOs in a solution/project named Doug.Zapp.Business, then you would create a BO Mapper project this assembly. If you create a new solution or move the project into a new solution, that is fine, just select the exiting BO Mapper project instead of creating a new one.All of the issues you are fighting here sound really strange. You are welcome to post a sample with a database and simple project showing your issue and then we could go from there if this doesn't get you going as the run-time issue you are fighting is going to be unrelated to the design-time.
|
By Doug Zapp - 1/6/2009
Trent,
I was attempting to create a sample app and dB (rather than send my production code), and for some reason or other, it works (I don't need to qualify my stored procs or table names). I don't think I did anything different.
If I were to create a new project for my BO's and copy my existing BO's to this project, then re-build everything once I've defined the project's properties in the Mapper, could this potentially clean up something I've done? Or is this more a factor of the entire solution?
Thanks,
Doug.
|
By Trent L. Taylor - 1/7/2009
Doug, that is the direction I would go. This whole episode has seemed a bit strange anyway. I cannot even think of what could be causing it past the things mentioned in previous posts.
|
By Doug Zapp - 1/8/2009
Trent,
Another naive question. How does the SetDataSources method in Program.cs relate to the data connections for the Business Objects (if there is a relation at all)?
Thanks,
Doug.
|
By Trent L. Taylor - 1/8/2009
Well, this SetDataSources method is where you should be setting up the data sources for your BOs at runtime. You can technically setup the DataSources anywhere prior to actually calling a query on a BO, but the SetDataSources method is where you define all of your connections that will be used at run-time by the BOs.
|
By Doug Zapp - 1/8/2009
Does the naming of the data connections relate to the Project Names set up on the BOM?
|
By Trent L. Taylor - 1/8/2009
No, it relates to the DataSourceKey setup on the BO. I would highly recommend reading through the help as all of this is outlined. It would probably clear some of this up instead of little segments coming from me.
|
By Doug Zapp - 1/8/2009
Trent,
This may be a more telling of what my issue is. I have a stored proc to retrieve my data for the BO. The BO object is pointing at a table in my production dB. In debugging, when this stored proc is called, my SqlCommand variable has a ConnectionString as follows:
"Data Source=mycomputername\\SQLEXPRESS;Initial Catalog=StrataFrame;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True"
This has to be the underlying issue. But why would this be pointing at the StrataFrame dB?
Thanks,
Doug.
|
By Doug Zapp - 1/8/2009
I believe I got this now. I missed setting the DataSourceKey for each Business Object. This wasn't pointing to the correct data source.
Thanks for the help.
|