SQL Server :: How To Go From Single To Multi-tenancy
Jul 19, 2010
how to take a SQL Server DB that is meant for a single client and turn it into a multi-tenancy DB, for many clients? The DB has about 100 plus tables , a lot are lookup tables. There are lots of stored procedures and views as too.
I created a website with a single project solution. Each web page consists of C# code in a script block along with the markup. In order to make the website work with many languages, now realize that I will need to have the code for each page reside in separate code-behind files that can be combined with the markup in various languages. I assume this means that I will need a solution with a common project of code-behind files that is merged with a project of markup files for each language in order to create websites for host servers in the various countries. After I separate the code into code-behind files from the markup for each web page, I will need to know how to organize the solution for debugging and building each website and where to place each file.
I have this code which takes a value from a dropdown control as a parameter.
[Code]....
I'm now changing to a list control so that multiple items can be selected. So far I have some code that places the items selected into a string that looks like this:
'item1','item2','item4'
For the above example I would need all the the records returned when the field action_ref contains either item1 or item2 or item3.
Our current application is working fine but when you try to misbehave like we found out that When login with same user in multiple tab with different organization(there is a organization dropdown in the master page which sets the cookie whenever it is changed.) in tab one it is org 1 and tab 2 it is org2 , cookie has the later org 2 in it but when we go back in tab1(which had org1) and save the record org 2 will be saved with the record So can some one share some sort of a checklist with us which address these types of problem.
We have a simple ASP.NET app that uses the ASP.NET SqlMembershipProvider and all is great.
We want to create a second app on the same server, also use the SqlMembershipProvider, but a different "applicationName" so that the user accounts between the two apps are kept separate.
It looks like this would be possible by making the two different app domains (ie they each have their own web.config), but I'm hoping to just put them in different directories so I don't have 3 web.configs (one for each app, and the main one) that all have to be kept synchronized. So what I'm after is:
/web.config /APP1 (uses membership provider in /web.config, with userlist A) /APP2 (uses membership provider in /web.config, with userlist B)
It looks simple to define multiple membership providers that use a different 'applicationName' value.
But how do you tell the system.web.authentication node which membership provider to use?
I found a lot of stuff on this topic but nothing that matches my problem.I'm coding a simple search function and came up with this code:
Dimsql As String = "SELECT DMS_files.id, DMS_files.descriptionSV, DMS_files.description, DMS_MainCategories.categoryNameFI AS 'main', DMS_SubCategories.categoryNameFI AS 'sub' FROM [DMS_files] INNER JOIN DMS_MainCategories ON DMS_files.cid=DMS_MainCategories.id INNER JOIN DMS_SubCategories ON DMS_files.scid=DMS_SubCategories.id WHERE (DMS_files.descriptionSV LIKE '%" & str & "%' OR DMS_files.description LIKE '%" & str & "%')" If (User.Identity.IsAuthenticated = False) Then sql = sql &" AND DMS_MainCategories.allowPublicSearch = 1" End If
With this I get the error "Multi-part identifier 'DMS_MainCategories.allowPublicSearch' could not be bound". But if I put the line straight to the first string, like below, it works.
Dim sql As String = "SELECT DMS_files.id, DMS_files.descriptionSV, DMS_files.description, DMS_MainCategories.categoryNameFI AS 'main', DMS_SubCategories.categoryNameFI AS 'sub' FROM [DMS_files] INNER JOIN DMS_MainCategories ON DMS_files.cid=DMS_MainCategories.id INNER JOIN DMS_SubCategories ON DMS_files.scid=DMS_SubCategories.id WHERE (DMS_files.descriptionSV LIKE '%" & str & "%' OR DMS_files.description LIKE '%" & str & "%') AND DMS_MainCategories.allowPublicSearch = 1"
We are looking to integrate Memcached into our infrastructure, but have a security concern before we do. We run several platforms including ASP.NET and ColdFusion and have many app developers working many little applications across the different platforms. The concern is this: App A places item "dog" into cache.
App B reads item "dog" (or worse: App B updates item "dog")
After this happens, App A either retrieves bad information, or has already had its information viewed, aka "stolen". What we would like to do is make it so that each app can only interact with its own sandbox, and may not interfere with or read other application's data.
i would like to insert text in sql server that contains words like select and a single quotation mark but sql server gives errors like if i wanna insert this :
I have a few updatepanel in my asp.net webform . I'm doing some tests and I'm wondering how can i check what data send back to server in different situations ?
I have to choose between Server.transfer and Response.redirect for an Intranet application for navigation. I have chosen Server.Transfer as of now because it avoid extra round trip to server and which will help when so many users will be accessing the application. (I believe this is the main difference between reponse.redirect and server.transfer). But the problem is now that URL won't change on Server.Transfer(I don't want to implement Http headerS, as I am afraid it will take time to implement that).on redirection, I want to do something like taking benefit of server.redirect(in avoiding server processing, which happens in response.redirect) and changing the URL(as it happens in reponse.redirect).Can anyone please suggest a quick solution to it or may be help me Telling How many users can reponse.redirect can support ?
Using a ListBox, where multiple items can be selected. Using StringSplit SQL function the string passed from Listbox is separated where the delimeter is comma ( , ).ListBox is in search form where user enters search criteria using other controls and the ListBox. All works good by simply using below SQL statement in Stored procedure that carries search.
[Code]....
Question:- Now one of List Item is None , when None is selected or None is selected with other ListItems from ListBox it is required to retrieve all records where COLUMN IS NULL.Example: When the Male, Female and None is selected from ListBox, SQL statement in Stored procedure will be
[Code]....
Like to know how this can be handled? It is required to retrive NULL values when None is selected in ListBox as well as in combination of other ListItems(Male and Female) i.e., Male, Female, Null when user selects multiple items from ListBox.
I want to create password in single database for example when i attach My database abc.mdf or open that database then it ask me password. as like access database password..
I'm looking to build a user control where the user should be able to select N number of files for upload using the same "file/explorer" dialog/control. Currently, the FileUpload control enables a user to select only one file for upload. I have seen examples where people have modified this, so that uploaded files are stored in a list to provide a "mass upload" functionality. However, the user can select only one file at a time. This is NOT what I want, the user should be able to select multiple files at a time, or select a folder with which I should be able to upload all the children images. Is there any way I can do this or has someone done this already and i'm somehow missing it?
I've been given a big chunk of code which eventually calls upon the SetDocsMetaInfo method from Frontpage Server Extension RPC. This is easy enough for most document uploading and property updating, except when dealing with multichoice fields. I've been scouring through MSDN and I can't find anything on how to fill in multiple values for such a field.
The general syntax for properties is something like this: [SR|default], with the type (string in this case) followed by a pipe and then the value to be written. Does anyone know the syntax for multichoice fields?
how can i use multi javascript files with RegisterClientScriptInclude method in custom server controls. when i call two or more RegisterClientScriptInclude method, this method registers only one of the javascript files.
Any one know any open source user control that is similar to gridtreeview. Basically, I want to show a multi column treeview that when expanded, user can edit certain column values. The columns can have a text box or dropdown etc.
select good.fromwho , good.applesdate, good.starttime , good.hungupfromwho from apples good where ( good.type = 1 and good.result = 2 and good.fromwho not inselect bad.towho from apples bad where bad.type = 2 and bad.result = 1 and bad.applesdate >= good.applesdate and bad.starttime > good.starttime )
What I want to be able to do is add to my top selection statement columns from the "bad" table. If I try, it gives me
The multi-part identifier "bad.towho" could not be bound.
I have a stored procedure that returns 3 tables within the single recordset it returns. If I set a SqlDataSource to get data from this procedure, it works, but it only returns the first table. I want to have a GridView display the data from the 2nd or 3rd table using a SqlDataSource, but I can't figure out how to specify a particular table.
While there are some posts discussing this out there, I can't get a definitive answer about whether or not this is even possible (?). In a worst-case scenario, I can create another SP that only returns the 3rd table - but that creates a little maintenance headache that I would prefer to avoid.
For context: First of all, I am new to LINQ, as I have been using SubSonic for quite some time now.
I have two tables, Users, and Affiliates. They both have a very typical schema. The FK that joins them is the UserId field, which is in the Affiliates table. I want to create a LINQ query that pulls the Username from the Users table using the AffiliateId value. The AffiliateId is a primary key of the Affiliates table.
I have tried to accomplish this using many variations of the following code:
[Code]....
In the above query, I expect to get a single row result set. However, I instead receive the entire table of results.
How can I make this work? I have yet to see an example or article out there to do what I am trying to do.
I have huge excel files that I have to open from web browser. It takes several minutes to load huge file. Is it possible to open a single worksheet (single tab) at a time from excel file that contains many worksheets? I have to do this using C# / asp.net MVC