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

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..

Related

How to develop an ASP.NET Razor Pages web application using a cloud database?

I have been using local databases to develop web applications in ASP.NET Razor Pages. My experience was that the local database creates itself simultaneously with the development of the web application.
Currently, I need to work with a cloud database set up in Microsoft Azure. This cloud database already contains tables. How can I connect to the cloud database and call these tables and their attributes in razor pages?
You need read the offical document first.
There are two ways you can set your sqldb connections. One is written in the appsetting.json file, and the other is set in the portal, as mentioned in the official documentation.
The difference between the two is that the setting priority in the portal is higher than the configuration in the code file, and the configuration will be overwritten when it is released.
For novices, you can get the Connection strings in the portal. Then you first ensure that your program can run normally, and replace the connection string in the appsetting.json file with the string provided in the portal. If normal CURD operation is possible, then the connection is successful.

Azure VM Database

I just got finished creating a VM in Azure and called it vm123. I was trying to use that VM when creating my SQL Server.
When I create a SQL Database in Azure, it forces me to either create a server or pick one from dropdown.
Why can't I see my vm123 in the list?
I can create a new one alright, which is what I did, since my VM did not appear in the dropdown. How do I remote into it?
See screenshots...
You are confusing VM with the Database server, the one asked in the dropdown is a SQL server not a VM. Those two are two different services on Azure.
To fix this create a SQL server resource first and you should be able to see that in the dropdown when you create the database.
Azure SQL Database is a managed service and the underlying infrastructure is shared across tenants.
If you really need access to the host then you'll need to choose from one of the following:
Create a SQL Server VM (includes licensing but at a higher operational cost)
Create a Windows Server VM and install a SQL instance on it. You must license it yourself accordingly.

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

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...

Install Sharepoint on a server with other databases already on it?

We have a DB server with a couple web app db's on there (don't get a ton of traffic). We'd like to make use of the server and allow it to be the DB server for sharepoint. I'm assuming it's not good practice and that sharepoint should have it's own exclusive db server. Am I right in that conclusion, or is it alright if we put the database on a server that already hosts other databases.
You can install SharePoint on an existing DB server, sure. Unless your environment is going to be huge, I don't see why you would give it its own DB server. It will use an embedded SQL Server instance if you want, but you'll get better performance if you have the full-blown version. We're running a few SharePoint apps on our DB server with a number of other applications.
The way in which I solve this is to install a second SQL Server instance dedicated to SharePoint, as SharePoint likes to have a lot of control over the database and spews all sorts of stuff such as logins, etc. across the instance, which you really want to separate from your standard line of business instance.
The added bonus is multiple SQL Server instances on the same physical machine are included in your licence.
Be careful with the SQL Server collation. I think SharePoint requires a particular setting for this. See http://www.moss2007.be/blogs/vandest/archive/2007/07/24/sharepoint-2007-and-sql-server-collation-latin1_general_ci_as_ks_ws.aspx for one reference.
Prior to centralizing our environment we had many Sharepoint sites located on servers with existing applications. I'm not a fan of adding an additional named instance as this increases the administrative overhead for the DBA. You have to know how much use you expect of your Sharepoint instance then measure the resource utilization of your existing applications balance it from there.

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