This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, i am testing Lightspeed for use in our .NET applications (VS 2008) but i have problems. When i use Lighstpeed against SQL server everything works well (i followed instructions on "Getting started screencast"). Then i tried to use the same example with Oracle Database 10i. I've created test project (Console Application), made connection (with server explorer) to Oracle Database, added new Data item (LightSpeed Model) in test project and dropped one table from Oracle to Lighstspeed model. I did same steps as they are in "Getting started Screencast". When i run test application i am getting error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
My app.config file is <?xml version="1.0" encoding="utf-8" ?> <configSections> <connectionStrings> <lightSpeedContexts>
I suspect misconfiguration in app.config file.
How should my app.config file look like? Is there any turorial how to use lightspeed with oracle database (basic stuff)?
Thank you for your answers.
|
|
|
Your app.config looks fine -- I suspect the issue is with the way you're loading the LightSpeedContext in your code. What you should be doing is this: LightSpeedContext context = new LightSpeedContext("default"); Note you need to specify the configuration name. I suspect what you're doing is something like this: LightSpeedContext context = new LightSpeedContext(); // creates blank context I know this technique is shown in the screencast but it is actually extremely bad guidance and I keep asking our screencast guy to redo that screencast and remove it! The reason it's bad is because it requires you to know and remember all the properties to copy -- in your case it looks like you didn't know to copy the DataProvider setting. And of course the copying version is a whole load more code, which is always bad! Just ignore that bit of the screencast and stick to the "named configuration constructor" shown above and you should be good to go. |
|
|
By the way, there's more advice on creating a LightSpeedContext here: http://www.mindscape.co.nz/blog/index.php/2009/01/12/creating-lightspeed-context/ See the last code snippet in particular. |
|
|
Thank you Sir. It works! |
|
|
Ok.. i've successfully created connection to Oracle database.
I have another problem. When I try to drag new table i recieve this error: "Exception while processing Server Explorer drag: System.ArgumentException: No identity type corresponds to Decimal" Does that mean, that i have to manually create this table in Lightspeed model? |
|
|
Sorry for the delay in replying (holidays!). This probably means that your identity column (primary key) is defined as containing decimal numbers rather than just integers (i.e. it has a nonzero scale). For numeric IDs, LightSpeed supports only integer types. If you have control of the database, and you don't actually need fractional IDs, you could change the column to have a zero scale. If that's not an option then sorry, yes, you will need to create the entity by hand. But note that LightSpeed will not be able to handle fractional IDs so you are likely to encounter errors at runtime in this case. |
|
|
Just to add... if you don't need fractional IDs, but can't change the database for whatever reason, let us know and we'll see if we can convert this to a warning or something instead. |
|