Migrating from Access db to SQL Server 2008 with frontend ASP.net - asp.net

I did the upsizing of access database to sql server. My question is, do I have to change all my datasources in webpages manually or is there any way to do that without much effort.
Edit: The queries I have uses user input I mean #WhichUser and sql server throwing error for those asking me name the scalar variables. Normally # symbol works in sql server but not in mine. Is this because I am using an express edition or is there anything else that I need to add to the query. Thanks!

I found that I named Control Parameter names same as column names while I used Which infront of every input parameter like #WhichUser so was solved by adding WhichUser as name to the control parameter.

Related

Copy some entries from one server database to other server database using asp.net mvc

We are doing some CRUD operation in DEV environment and data is saved in database. For other environments(like Staging/Prod) we want to copy those records from DEV database and paste to Staging/Prod when required using asp.net MVC. Is it possible? Could you please suggest some pathway in order to accomplish this?
You can accomplish this using a linked server:
https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-ver15
This involves creating a link between one database server and another (they must be able to see each other on the network). You can then reference the linked server like this:
INSERT INTO [LinkedServerName].[Database].[dbo].[Table] (......
Alternatively you could use a paid for tool like SSMS tools which can generate insert statements on a per table basis: https://www.ssmstoolspack.com/

SQL Server Data Tools - Find all external references

I'm trying to create a DACPAC for an existing SQL Server database, but I am getting errors because of external references.
I'd like to try to get a full list of ALL the external references in SQL Server along with information about the stored proc/view where they are located.
Is there a query I can run in SQL Server (2017) to return this information?
EDIT: To clarify, I don't want to suppress the errors, I want them to be addressed, but I need the full list before I can proceed.

Visual Studio Server Explorer doesn't display the correct table with DB2 connection

To start off, I'm new to Visual Studio and DB2, so please bear with me. I've been reading different books and will be starting classes soon, but I'm completely stumped with this.
I have a webform set up using VB.
In the web.config file, I've added <add name="rfqAS400TEST" connectionString="Server=serverIP; Database=RFQTST; UID=userid; PWD=password; CurrentSchema=RFQTST;" providerName="IBM.Data.DB2"/> inside of the <connectionStrings> tag. However, when I look at the connection in the Server Explorer, the tables dropdown shows HUNDREDS of tables, none of which are the table I referenced in my connection string.
I've tried to modify the connection and filter by the schema and DbName with no luck - it still only shows the hundreds of other tables instead of the one I want.
When I manually specify a custom SQL statement (SELECT * FROM <library>.<filename/table>) in the GridView Configure Data Source wizard, the GridView displays the records as it should, so I know the connection to the correct library and file is working.
It just seems strange that I have to manually type the statements because the correct table fails to show up in any of the wizards or the Server Explorer. Any suggestions or thoughts would be GREATLY appreciated.
Update
Out of curiosity, I tried to set up the connection using the ODBC datasource and the system data source name as IBM i Access for Windows ODBC. This displays extra tables as well, but it includes the tables that I've been wanting all of this time. This just confuses me more. Does that mean the DB2 connection (even though it technically is connected) is set up incorrectly?
The CurrentSchema is just a proxy for the SET CURRENT SCHEMA, to name the implicit schema qualification, for unqualified table-references. The tables that appear in an ODBC API request such as via SQLTables(), are unrelated to that current_schema.
A generic [db2] provider does not acknowledge\reflect the distinct attributes of the DB2 for i, whereby the database is [in a simplified sense] the entire system; the catalog API calls reflect either that, or that the schemas that are part of the library list concept. With the IBM® i Access ODBC driver, there are Connection string keywords for Connection Properties and Server Properties.
The following Redbooks publication and SQLTables Description may have some value.

Entity Framework 5 code first - where is the database created

I am following along this tutorial! everything works great, the blog names saved and retrieved from the database (assuming) since they are displayed in the console. Yet there I don't find any database created for it in local db nor the sql express on my machine. How to find where is the database created in the code first approach.
You can get the connection string by using ctx.Database.Connection.ConnectionString which will tell you what database you are using.
I was having a very similar problem here. My connection string was set to .\SQLEXPRESS and a generated Initial Catalog name, but when I connected to .\SQLEXPRESS using SSMS, nothing showed up.
Using IntelliTrace in VS 2010, I was able to see the ADO.NET command, and in the Autos grid, it showed me the SQL command and the following connection string: Data Source=(localdb)\v11.0;AttachDbFilename=|DataDirectory|(my_context_name_here).mdf. Then, using the Server Explorer I can connect to (localdb) and see the data.
This problem happened because my context was derived from DbContext, but it did not used the base(connectionStringName) constructor (like the UsersContext that comes with the MVC4 template does). Changing that, I can see the database in .\SQLEXPRESS.

Wordpress with SQL Server backend stores "????" instead of Cyrillic characters

I have a wordpress installation on sql server 2008 r2. I am not a php man myself, so I'm not really sure how to attack the php side.
On the sql server side I can see question marks being stored, so this is not just a presentation issue.
I am thinking maybe the insert itself does not have an N before the string.
Can anyone point me to where I can start looking in the php files, or even better is there is a known solution for this issue?
Edit: I already checked and all fields are nvarchar.
Edit 2: I just manually inserted the data into the DB and it is stored correctly.
Check your wp-includes/wp-db.php file.
Wpdb is the core database object used for db operations.

Resources