|
|
I am new to the MVC and Html helpers.please explain the how to send data from controller to view
|
|
|
|
|
|
|
I have visual studio solution with two projects. Both use an identical connection string to access a SQLExpress DB. Project A works without problem. Project B cannot connect to the DB, throwing the following error message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I have been reading various forums for months and have confirmed the SQL Server settings, firewall settings are correct. I feel confident that the SQL Server side settings are correct, given Project A connects without issue.
I developed this project many years ago, and the run time application has been in use without issue. I now open the solution to make a change to the source code and cannot recompile due to this connection error. Any advice would be greatly appreciated.
|
|
|
|
|
Either the server side settings are incorrect, or the connectionstring is.
Mtt123456789 wrote: I now open the solution to make a change to the source code and cannot recompile due to this connection error. You should still be able to compile, it is a runtime error, not a compile-error.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Your right, i can compile, but the application will then throw an exception when accessing the SQL Server in runtime.
I am sure the connection string is correct because:
a) Syntax check is Ok on connection string builder
b) I have used this same connection string in many other applications without error
c) Another project in the same solution uses this Connection string.
And if it works in Project A, I cannot understand why project B does not work using the same conditions.
|
|
|
|
|
Mtt123456789 wrote: And if it works in Project A, I cannot understand why project B does not work using the same conditions. Because there might be other details.
What about you post them both here; we'll take a look at each option and verify for both servers.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: verify for both servers
I would like to clarify that both projects are accessing the same SQL Server/DB, using the same connection string.
The connection string is:
"Data Source=SQL1\SQLEXPRESS2;Initial Catalog=DB1;Integrated Security=True"
The data access for Project A code is as follows:
Dim conn As New SqlConnection("Data Source=SQL1\SQLEXPRESS2;Initial Catalog=DB1;Integrated Security=True")
Dim strSQL As String = "SELECT Column1, Column2, Column3 FROM [DB1].[dbo].[Table1] WHERE Column1 = 3"
Dim cmd As SQLCommand = New SQLCommand(strSQL, conn)
conn.Open()
The data access for Project B code is as follows:
Dim conn As New SqlConnection("Data Source=SQL1\SQLEXPRESS2;Initial Catalog=DB1;Integrated Security=True")
Dim strSQL As String = "SELECT Column3, Column5, Column7 FROM [DB1].[dbo].[Table1] WHERE Column7 = 9"
Dim cmd As SQLCommand = New SQLCommand(strSQL, conn)
conn.Open()
|
|
|
|
|
Where is the DB server installed? On the same PC as Project A? If yes, check whether SQL Server is allowing remote connections.
Are all the computers on a domain?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The DB is on a remote server. The application is on my local PC which is part of a Domain.
The server does allows remote connections.
|
|
|
|
|
Mtt123456789 wrote: The application is on my local PC Project A or B? Is any of both on the DB-server? If yes, is TCP/IP enabled?
Create a console application, minimal setup; check if you can connect to the server, not selecting a database, using the SA account
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Project A and Project B are both in the same Visual Studio Solution, on my local PC. (Not on DB Server)
In any case TCP/IP is enabled.
I have created a console app as you suggested. I can connect to the server using both Integrated Security and using the sa account.
If Project A can connect and the console application can connect, it would be a reasonable assumption that the SQL config and the connection string are correct.
...But back to the error message "Error locating Server\instance"
Matt
|
|
|
|
|
Are both projects being run by the same user account?
|
|
|
|
|
Yes Dave, both projects are being run by the same user account.
|
|
|
|
|
The only other thing I can think of is outbound firewall rules on the client machine. An exception may exist for one project and not the other. This would cause the error you're seeing on the project that doesn't work.
|
|
|
|
|
I have resolved the problem..
The Build Output path (In project properties) was set to a network share, once i changed it to a local directory the problem was resolved. The network share is a trusted location, so i'm not sure why this was failing.
Thanks for your help guys.
|
|
|
|
|
Thank you for posting the solution. Too many forget to do that when they solve their problems.
Have my 5.
while (true) {
continue;
}
|
|
|
|
|
I can read short texts in different languages, the voice that somehow the computer? How traced a path for such a project?
For example, a computer selected from English, German or Russian will start to be performed after pressing the text button.
|
|
|
|
|
Uhhh... What?
I can appreciate that English isn't your first langauge but that didn't make any sense at all. You might want to try having someone with better English skills or have an attempt at Google Translate.
|
|
|
|
|
I've several Silverlight applications.
I enjoy the async programming model and ease of deployment.
All of the applications are OOB (Out of Browser).
All are in Visual Studio 2010.
What should I be doing at this point to move out of Silverlight?
Is it possible to upgrade to Visual Studio 20XX, convert the applications to XXXX and distribute via the web?
I probably should get on this....
|
|
|
|
|
You problem is that Silverlight (and other similar things like Flash) loosing support (Flash i about to be 'killed'!), so you have to look for something, but actually no real substitution...or at least not an easy one or even half-automatic...
The only current substitution is HTML5 - and there is a lot of problem with it still...
There is not know 'best-practice' to do such a transition (for sure there is no simple update/convert), but there are companies/solutions that claim to solve the problem...
You should search for 'convert silverlight to html5' and start reading...
One of the best I saw is this: http://wijmo.com/a-smooth-transition-to-html5-using-mvvm/[^]
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
I have an XML document that needs to pass through 4 users hands, each using the public key to encrypt and send it to the next person. The public keys and private keys are stored in the XML file, with each user's private key being protected by SYMMETRIC encryption to which they know the password.
The .NET EncryptedXML class does not seem to handle this case, specifically the .encrypt and .decrypt methods of this class do not allow me to pass in an ASYMMETRIC key.
Am I left to encrypt the necessary XML elements using the "regular" encryption classes, or is there a way that I'm not seeing?
TIA, Randy
|
|
|
|
|
how to add pdf file dynamically and download it through ancher tag in asp.net
|
|
|
|
|