Can we use external database in silverlight business application instead .mdf file - silverlight-4.0

Can we use external database in silverlight business application instead .mdf file? And if not how to observe database tables and records in mdf file?

Silverlight does not have any straightforward direct db access feature. You'll have either:
create a service (RIA service for instance)
or use COM in elevated trust mode.
Both of which can potentially give you access to any db, not access dbs only.
RIA services can leverage linq to entity for which you'll find implementations for SQL server, Oracle...

Related

WCF EF code first syncronization best practices

There is a offline WPF client and WCF server.
Client use SQL-CE or localDB - EF-Code first
For example, for the following scenario - Administrator can edit the common information and to add jobs to Users, and the user can see the lobules added him the job, and synchronize changes made when a connection.
Prompt the best way to synchronize reference data.
Looking toward the "microsoft sync framework" - but it seems that then have to implement your own provider. Maybe there's an easier way?
SQL CE and LocalDB are both supported out of the box in Sync Framework. you can use the same SqlSyncProvider against the LocalDb
no need to write custom sync providers.

Questions about local database vs service-based database

I have a some questions about local and service-based databases: Does using a service-based database require the user to have SQL Server installed? If so, is there ANY way around it? Does a local database require the user to have SQL Server installed? What is the difference between a local database and a service-based database. (I am talking about the items in Visual Studio)
Clients do not need SQL installed to programatically connect to a database located elsewhere. Whatever mechanism contains the code to connect to databases in general will create the connection. For example, the System.Data namespace of .NET takes care of this for .NET programs. SQL installation is not necessary. Management tools, of course, will not be present on the client.

aspnet_regsql.exe and MVC

Can someone explain what aspnet_regsql.exe is really used for?
When I create a standard ASP.NET MVC project in VS2008 and register a user, I get the db created with corresponding asp.net membership tables etc.
This uses the SQL Server Express 2005 as standard.
The forums I have found states that aspnet_regsql.exe is used when one is migrating the created SQL Server Express db to a SQL Server, fx. to a hosting server. I am right about this?
But is this change a global change, meaning that next time I start a new MVC project or standard Win Forms project and add a db, it will use SQL Server as provider and not SQL Server Express? Or is this aspnet_regsql.exe only used on a project basis?
Like you say, the aspnet-regsql will create the tables into any (Express or not) version of SQL Server. I -think- your main question is how do you know which database you're attaching to, right? If so, then that is handled in your web.config file in the "Membership" provider area. What I do is use a SqlMembershipProvider for my development (utilizing the tables created with aspnet_reqsql) and then switch to ActiveDirectoryMembershipProvider for production.
MSDN Article on aspnet_reqsql
aspnet_regsql.exe is a utility designed to prepare a database to work with asp.net providers. These providers provide services to asp.net applications such as user membership, roles, and profile management and require a database that adhere to specific schemas.
By running this application you can alter an existing database to adhere to these schemas or create the default database for these services (aspnetdb.mdf?).
I believe that the utility might also prepare some of the intrinsics for provider usage.

Data access in Silverlight 2.0

I'm new to silverlight and I'm porting from asp.net 2.0. I have done many data binding applications in asp.net where I use sql server 2005 and use it's tables and access them via sqlconnection object and perform all kind of database related functions. Can anyone tell does silverlight 2.0 supports such kind of facility. If so can I use any database server, if not is it through web services? can anyone point me some good place to start with.
No you can't connect directly to a database server. You need to use a web service. However to simplify things you can call a data web service such as SQL Server Data Services or Amazon S3. Otherwise use REST.
Silverlight is a client side technology. You can't access a database on the server directly. You have to use a layer in between, like webservices. For a nice tutorial on how to do that, check http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx

How can I load different endpoints for WCF in SQL CLR?

We're deploying some new WCF calls in our SQL 2005 DB using the CLR. In testing, I hardcoded in the code the endpoint to connect to, and deployed it to our test server. When we go to deploy this to production, we will be deploying it to many different SQL DBs, and using different endpoints to connect to (same service running on different servers). How can something like this be done? Is there a config file that can be referenced for the deployment of the dll into SQL?
The solutions above would work, but we found that the best practice approach would be to create a new table storing all of the different endpoints into the DB. Then, we updated the CLR to make a call to this table to get the endpoint(s) that were needed. So each server would have the proper metadata loaded for it, and it would all be retrieved from the DB. No hardcoding this way, and there's no need to worry about external text files on the SQL server. It's all contained in the DB.
Accessing Application Configuration Settings from SQL CLR
another technique..