1
Answer

Connecting Visual Studio 2010 with Sql server 2012

Sachin Chauhan

Sachin Chauhan

11y
1.8k
1
Hi,

I am not able to connect sql server 2012 database with visual studio 2010 ultimate version. I have installed VS 2010 service pack 1 while installing sql server 2012. I am getting below error:

"The database C:/USERS/SACHIN/DOCUMENTS/First_Database.mdf can not be opened because it is version 706. This server supports version 655 and earlier. A downgrade path is not supported. Could not open new database C:/USERS/SACHIN/DOCUMENTS/First_Database.mdf.CREATE DATABASE is aborted. An attempt to attach an auto-named database for file C:/USERS/SACHIN/DOCUMENTS/First_Database.mdf failed. A database with the same name exists or specified file can not be opened, or it is located on UNC share."

Can you please let me know the reason for the error and how to resolve it?

Answers (1)
0
Riddhi Valecha

Riddhi Valecha

NA 3.1k 186.7k 7y

Hi..

Datatable has 4500 records. It is not empty.

 
Yes, I have mentioned all the lines...
 
cmd.CommandType = Stored Procedure 
----------
Hi all...
 
I have one more query.... Instead of WCF Service , now I am asked to do .asmx web service.
 
I need the user to insert the following values -
1. Name - string values - no number 
2. Location - String values
3. Email ID - abc@xyz.com - check if email id is valid
4. Mobile Number - Numeric values
5. Date - date must be greater than current date.
6. Select city from drodownlist.
----------
 For this, I have made -
1. A Class File with get; set properties (UserDetailsProperties.cs - Name of Class File).
2. I have made a method to return Boolean with Class Name as parameter.
public Boolean IsDataIserted(UserDetailsProperties userdetails)
{
cmd = new SQLCommand();
cmd.Parameters.AddWithValues("@Name", userdetails.Name);
int i=cmd.ExecuteNonQuery();
if(i<=0)return true;
else return false;
}
-----------
My Query is -
How do I test this functionality with .asmx service ?
 
http://localhost:12456/UserWebService.asmx - This is the URL.
 
------
And how do I get the output in JSON?
--------------------
 When I upload the webservice in server (iis), then is there a way so that instead of fields , we can have dropdownlist , datetime picker as inputs ?
This is when - we hit the url - http://1.2.3.4/UserDetails/UserWebService.asmx - click on the method and click on "Invoke" button.
------------
Please guide
 -----------------------------------------------
Dear All...
Once again I am stuck up with Basic Authentication of the Web Service...
 
Requirement - When the user hits the URL - http://localhost:34789/WebService1.asmx ; then
1. A popup or method must be displayed -  Please enter Username and Password.
 
2. If the user enters "Riddhi" in Username and "12345" in Password, then the message should be displayed -  Successfully Logged In... and display other Web Methods - Add ,Subtract, Multiply, Divide 
 
3. Else - A message - "Authentication failed" - must be displayed.
 Please guide for this... 
 
 
0
Ankit Sharma

Ankit Sharma

NA 8.8k 141k 7y
Hi riddhi,
 
You might be getting this error coz your datatable is empty.
 
 since you are using a SP, so you need to include following line in GetUserList() method 
 
cmd.CommandType = CommandType.StoredProcedure;
 
Also check if your connection string is valid or not