ASP.NET and MySQL Connector Net - asp.net

I am using latest version of MySQL connector Net to connect to a MySQL database from an ASP.NET form. I have copied the files MySql.Data.dll, MySql.Data.Entity.dll and MySql.Web.dll in the Bin folder of my ASP.NET application. Also I have imported required libraries using these lines:
Imports MySql.Data
Imports MySql.Data.MySqlClient
The image below shows the code and the error that I am getting:
What is wrong with the code please?

I have found a sample, this might help. Click HERE for example describes using ASP.NET/MySql.Data to connect to a MySQL Database.

No idea where dataset came from, should be database=dbherpes.

Related

Asp.Net core library add

I am working on a simple project, where I have a asp.net core library named "BusinessApiClient" version-1.6 and have a web application project named "MyWebProject". I want to add "BusinessApiClient" in "MyWebProject" as reference. But my problem is its always showing error in reference list.
Project.json :
Don't know why its showing error !!!
Hope will get any help.
Thanks in advance.
You need to create your own nuget packages of your Businessapi client.
More information :
Nuget info
+
Than you can put that nuget package in a local folder and use that as a feed: More info
Goodluck!

MyGeneration.dOOdads problem with MySQL connection in ASP.net with stored procedures

I am using MyGeneration.dOOdads which helps in generating Business layer and Data layer easily, but currently I am facing a problem with it.
I had worked with MS SQL database and was successful, but now I have to work with MySQL 5.
I have the generated data layer classes of MySQL database successfully, but when I add them in my project along with the reference of MyGeneration.dOOdads dll file it gives error of no MySql4Entity class in the namespace.
I have generated the class according to the given instructions and also added the reference of mysql.data in the project but still this error is occuring.
Please guide me if you have used MyGeneration.doodads for MYSQL5 database in asp.net.
Also please tell me how to make stored procedure using MyGeneration.doodads of MYSQL database?
open doodads project (source code) .. right click on MySql4Entity class (and other classes related to mysql) and choose 'properties' the choose build action as 'compile' from the list ... to compile the file then build the project and it its output as reference to your project ...

Visual Studio Advanced Query Builder MySql adding “def.” before the table names

I am trying to create dataset (.xsd) and link it with stored procedure in MySQL database.
the problem is when i connect it it's changing the schema name.
like if I have this stored procedure name or table name or whatever :
News.tbNews
the builder it self change it to :
def.News.tbNews.
MySql version 5.5.8, MySqlConnector 6.3.4
I searched for a solution for this problem and one of the answers was to change the MySqlConnector from 6.3.4 to 6.3.6 !!!
I download the new connector 6.3.6 but it's giving me Error while installing it.
any Idea People ???
thanks and best regards.
Ok ,the problem is solved now
all what you have to do is : 1- install framework 4.0 before installing the .net connector 6.3.6

ASP.NET MVC 2.0 NHibernate Configure() issue

I have installed NHibernate for my ASP.NET web app although I'm getting a problem in real-time on the following line of code:
if (_sessionFactory == null)
{
_sessionFactory = new Configuration().Configure().BuildSessionFactory();
}
Looking at the inner exception the problem is this:
{"Could not find file 'D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml'.":"D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml"}
This makes sense, as the file doesnt exist in that location. This line of code is within my Core project. File hibernate.cfg.xml is currently in my Infrastucture project, not my Core. Should this be? I have copied the file into this location although I still get problems. If I manually copy the file into this location within windows explorer I then get the following error during runtime.
{"Could not load file or assembly
'Infrastructure' or one of its
dependencies. The system cannot find
the file specified.":"Infrastructure"}
Also, I'm missing DynamicProxy.dll as I'm using castle and I couldnt see a version of the DynamicProxy in the castle folder that I downloaded from http://sourceforge.net/projects/nhibernate/
any suggestions? I can see LinFu.DynamicProxy.dll within the download although it says I only need one of the folders, Linfu or Castle, and I'm using Castle for this experiment. Not sure if this has anything to do with it, just thought it might help.
any ideas? Many thanks,
James
About "Could not find hibernate.cfg.xml": you can either set it to "Copy to Output" (see this) or configure it as an embedded resource.
About "Could not load assembly Infrastructure": you're missing Infrastructure.dll in your bin, or one of its dependencies, just as the error says.
About missing DynamicProxy.dll: if you're using NHibernate 3.x all you need to use the Castle bytecode provider is NHibernate.ByteCode.Castle.dll and Castle.Core.dll

Active Record and Linq T4 Templates problem

I've started a C# web application project using subsonic 3.0.3 as my DAL and SQLite for database.
It doesn't have any problem when using SimpleRepo, but the problem occurs when I try to use ActiveRecord/Linq T4 templates.
It says "Metadata file 'System.Data.SQLite' could not be found". The settings.ttinclude is the one provided with SQLite.ttinclude file and its config looks ok, and other files are instructed to use SQLite.ttinclude of course. I've also tested them with an SQL Server database and everything goes fine.
Also tried searching about it on the net and all I could find were these:
Subsonic Google Groups which instructs me to add a reference to System.Data.SQLite to the top of settings.ttinclude. No luck.
Someone at here commented about this issue, and it was answered to check the connection string, which doesn't seem to be my problem, because the app works when I use SimpleRepo.
Is SQLite installed on your machine? You need the .NET driver for it as well (that's what can't be found).

Resources