I use the class below in my code-behind to connect to my database. How would I (overload?) this class to choose between multiple connection strings (databases)?
Or should I have a separate class for each connection?
Since I'm using Postgresql and can't use LINQ to SQL, I wrote my own wrapper classes.
This is a part of the Student class:
[code]....
It works now! I replaces all Run methods in the Student class with DB.Run
But I want to know if it will work fine with a lot of people online, not me only. I'm not sure how static things work with ASP.NET, maybe it'll eat a lot of memory?..
I am new to Visual Studio 2010 and ASP.Net, and when I first connected my SQL Server to Visual Studio it created huge files full of my SQL classes (maybe this was LINQ classes), and I accidently deleted/corrupted those files, and now I want it to create those classes again. Can someone tell me how I can do that?
it's possible to put the database connection settings into a base page class so that I can auto-init them on a page. like this document: [URL] but with instructions in VB.net
I am preparing for an Access2007 db conversion at the beginning of the year and would like to know what the best process would be for connecting to the sqlserver2005 database. I have read about adding the connection string to the web.config file. I have also read about using ADO.NET and put the connection information into a class and not the web.config file.
I would like to hear from others as to what you have used, are using, or plan on using for a webapp (vs2010), and why so I can get an understanding.
I am using VS2008 and oracle 10g ODP.Net. The oracle database that I used in the connection is working and tested it using sql plus.The connection string when used in a GriDView works perfectly. Now when I created a new listview control with the same connection it gives an error.Database schema could not be retrieved for this connection. Please make sure connection settings are correct and the database is online
Object reference not set to an instance of an object at VSDataObjectSupport (478,6)
The tempSocket is connected to the particular IP and tempSocket.Connected is giving me value as True. But the property MultiCastLoopBack property is giving me the following error with error code 10042.
"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call."
So is there any problem with the IP or Tcp is not supported with Stream as SocketType?
I'm using the template posted in this thread to generate C# enums from a couple of lookup tables in SQL Server within a class library that contains my DAL.
At the moment, I have the connection string used by the templates embedded an a template include file in the class library. Is there a convenient way to have the template grab the connection string from the main project (WAP)'s web.config without having to include a physical path? Or is there a better way to approach this?
I've also considered creating a SQL CLR assembly which returns a table-valued function containing the enum contents (which would then be defined in C#, not in the database), but I'm not sure what the performance hit would be. Whether or not it's significant will obviously be application-dependent but I'd hate to charge down a crappy path if it's a know best-avoid-this approach.
Is it possible to make a sql connection in the master-file for my asp.net website, that all included sites have the connection too? Like when I include a header-file in asp classig.
I receive the following error, when trying to consume Wcf service:
"An existing connection was forcibly closed by the remote host". Consuming the service works fine when the host and the client are on the same machine. When I move the client to Hyper-V virtual machine (I didn't try it on a real computer) - it throws the error. Both firewalls are turned off Do you know what can cause such behaviour? Here are the details:
Both the client (hyper-v) and the service are on Windows server 2008 R2
Service url - http://wcftest/CalculatorService.svc (wcftest is the website and is mapped in the hosts file to localhost)
Service config:
[Code]....
Client config:
[Code]....
Are there any configuration settings which I'm missing?
have developed a Asp.net application which uploads data from Excell Sheet and then Inserts those data after doing several Checks to the Mysql data base.The Issue which Iam facing is that when Iam uplading lage amount of data at a time say around that 10000, the application crashes and gives the Unable to Open connection to server Error.The same app works well 1000-2000 data.
I am working on a web project(asp.net with c#),In app_code there are 10 class files(.cs). I want to make only one DLL of these files. How can i do this.
Task is to develop class libraries that can be re-use in projects but assambies should be copy righted. By this I mean developer will not give the code of class libraries to the clients yet they will provide the code of there sites/ applications, these libraries will be used just as internal development libraries. I want to make Business Logic Layer, DAL, Business Objects as class libraries
Q1. How I can control unathorised use of libraries ?
I got a design which I basicly use for 100's of websites, and have a virtual folder for masterpages with is copied from a project using build events.Each Masterpage (as this stage), I can rename them or change the names if it helps with this problem, but I need to be able to access the propertys in the masterpage code / dllso I have come up with this