DataSource Controls :: "MSSQLSERVER" Instance In "Connection Properties" Window Is Missing
May 4, 2010
I open VS2008/VS2010 and run some project, then I get a message prompts it cannot finds the server, and asks me if I want to look for it. clicking Yes and the next window open:
In this window I am looking for the server name, "MACHINENAMEMSSQLSERVER" but I just cannot find it.
I can see "MACHINENAME/SQLEXPRESS" server, but not the sql server 2008 instance....
The server is up and running, I have checked it, and I can access it as the sql server located on the local machine,
I am using Asp.Net MVC 2.0 for creating a user and assigning properties to the user at the same time. I am using my Windows account to access database on my local computer. I am using pre-installed MVC code o create a user with unique user name and password. User is created OK. Then I want to add profile properties like First and Last name at the same time.
where profileInformation is a RegisterModel and has user info.
When I am trying to:
profileBase.SetPropertyValue(.....);
I am getting the following error # 2147467259 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: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)"}
Why is my connection string works fine the first time and not working now? And how to configure connection to use TCP-IP?
I have SQL Server Browser running ander Local account and openned port in my Firewall.
Following is the error I am getting while accessing some of the pages on my website.
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
It is trowing an exception and giving the about mentioned error.
i get error 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
When I open an ASP.NET 3.5 project using VWD2010, I get a prompt error message,"The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place."however, my project works successfully.
why the assembly information would be missing for a project in VS 2010? There is an 'AssemblyInfo.vb' filed located in the 'My Project' folder with values provided for the title, product, etc and GUID. However if I open the 'Assembly Information...' dialog in the 'Application' tab of the properties for the project all the fields are blank.
In my DAL i have more than 100 methods/Function, each and every method am opening the sqlconnection and closing the connection, this is taking too much of time to establish the connection at every time. So what i expect is one common class will create the SqlConnection that will check if the connection is Broken or Closed then create the connection again else return the connection, how to do this(Also i would like to apply ConnectionPooling).
I've been working on this project for a few days now, and have been unable to resolve the issue of getting intellisense support for my custom-defined inner properties for a user control (ascx, mind you). I have seen the solution to this (using server controls, .cs mind you) many times. Spelled out in this article very well. Everything works for me while using ascx controls except intellisense. Here's the outline of my code:
[PersistChildren(true)] [ParseChildren(typeof(BreadCrumbItem))] [ControlBuilder(typeof(BreadCrumbItem))] public partial class styledcontrols_buttons_BreadCrumb : System.Web.UI.UserControl { ... [PersistenceMode(PersistenceMode.InnerDefaultProperty)] public List<BreadCrumbItem> BreadCrumbItems { get { return _breadCrumbItems; } set { _breadCrumbItems = value; } } ... protected override void AddParsedSubObject(object obj) { base.AddParsedSubObject(obj); if (obj is BreadCrumbItem) BreadCrumbItems.Add(obj as BreadCrumbItem); } ... public class BreadCrumbItem : ControlBuilder { public string Text { get; set; } public string NavigateURL { get; set; } public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs) { if (String.Compare(tagName, "BreadCrumbItem", true) == 0) { return typeof(BreadCrumbItem); } return null; } } }
Here's my mark up (which works fine, just no intellisense on the child object declarations):
I think the issue lies with how the intellisense engine traverses supporting classes. All the working examples I see of this are not ascx, but Web Server Controls (cs, in a compiled assembly).
I'd like to add some custom instance properties to an ASP.Net User object. for example, I'd like to log every user's login and have something like: User.LoginTimes or calculate the User Profile's Completion percentage and be able to access it like: User.ProfileInfoPercentage, etc.
Now What I'd like to know is what would be the best approach to do this?
Forget about user instances? (e.g. define a database table with userid and ProfilePercentage info and retrieve data from profile like: DB.GetProfilePercentage(Context.Current.User.UserID) ) Override the ASP.Net User class and add my own functionalities. Use Extension methods for the user class.
I built a prototype I'm looking to deploy. It uses a database file MySite.mdf that I created. At some point in the process, the database file ASPNETDB.mdf was added to the project.
When I look at the web.config file, I see the connectionStrings tag but in there I only see the nested tag for MySite.
Now that I'm looking to deploy, what do I put for the second file in the tag.
I've a requirement where i need to pass some objects across the pages. So i created a custom class with all the properties required and created a instance of it and assigned all the properties appropriately. I then put that object in the session and took it the other page. The problem is that even when i set the properties values to the class it is coming as null. I set a breakpoint in the getter-setter and saw that the value itself is coming as null.
public class GetDataSetForReports { private Table m_aspTable; private int m_reportID; private string m_accountKey; private string m_siteKey; private string m_imUserName; /// <summary> /// Asp Table containing the filters /// </summary> public Table aspTable { get { return m_aspTable; } set { m_aspTable = aspTable; } } /// <summary> /// Report ID /// </summary> public int reportID { get { return m_reportID; } set { m_reportID = reportID; } } /// <summary> /// All the accounts selected /// </summary> public string accountKey { get { return m_accountKey; } set { m_accountKey = accountKey; } } /// <summary> /// All the sites selected /// </summary> public string siteKey { get { return m_siteKey; } set { m_siteKey = siteKey; } } /// <summary> /// Current User Name /// </summary> public string imUserName { get { return m_imUserName; } set { m_imUserName = imUserName; } } }
This is how i'm creating an instance in the page1 and trying to get it in the page2. Page1 Code
//Add the objects to the GetDataSetForReports Class GetDataSetForReports oGetDSForReports = new GetDataSetForReports(); oGetDSForReports.aspTable = aspTable; oGetDSForReports.reportID = iReportID; oGetDSForReports.accountKey = AccountKey; oGetDSForReports.siteKey = Sitekey; oGetDSForReports.imUserName = this.imUserName.ToString();
But the values are not getting set at all. The values are not passing to the class (to the setter) at all. Am i making any OOP blunder?
I have myConnectionString and it's working fine. In the Server Explorer, the Data Connection is even using myConnectionString to connect to the database. When I created my .dbml, it uses that same yConnectionString. However, now whenever I opened the .dbml file, pops up with the following message:The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place.After this message is display and I clicked okay (because that's the only option), it creates myConnectionString2 in the web.config file with a different ID but no password provided. What is this all about? Why is it creating a second connection string with a different ID?
I'm using a SP to fill the drop down list and when I look at the values in the drop down list the first row of the dataset is missing.Here's the code I'm using, I've left out the database connection info and the link to the SP
StaffListRS = cmdStaff.ExecuteReader() If StaffListRS.Read() Then ddlStaffList.Datasource = StaffListRS ddlStaffList.DataTextField = "StaffName" ddlStaffList.DataValueField = "NewStaffID" ddlStaffList.DataBind() ddlStaffList.Items.Insert(0, New ListItem("All", 0) If
I would like to know why somethimes DefaultValue in properties window is displayed in bold text and somethimes in normal weight text? What i know is that the Value in Properties Window should display bold only if the Value is different than DefaultValue.
So i have a situation, where i need to set DefaultValue's and i'm successfully setting the boolean Value but failing in Integer value...
aspx:
[Code]....
Now the reason why i'm using Int32 in this example is that i hovered the mouse over the DefaultValue and it's said that "represents a 32-bit signed integer" but still no luck.
Why is my StepHour displayed bold and how to display this DefaultValue in regular weight text?
My UI layer calls my business layer which populates a DTO. I need to display properties from the DTO on my ASPX page. Should I create public variables on the code behind page for each of the DTO properties and reference like <%=PublicPropertyName%> OR is it ok to set the DTO instance to public and reference the properties directly like <%=dtoInstance.propertyName%>
Additionally, would it be better if I just created Literal and Label controls for every item on the ASPX page and just populate them from the code behind only?
The above code compiles without any error. Also I can drag and drop this control from the Toolbox of my Project on my web form. However I am unable the change the value of my fromLabel control.It allows me to change the value in the properties window.But when I run the form it always shows me its default value which is "From". I want it to be flexible so that any one can change the value in the properties window.
I just installed sql server 2008 R2 on my computer. I am trying to connect to sql server throught my C# code and everytime I run the C# program,
I get this error "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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) "
The connection string that I used in my web.config file is
[Code]....
I am not sure what am I doing wrong, but I followed this article below step by step and still I am getting the same error
As you can see, the connectionstring parameter is defined to a specific connection string name and I need to be able to set such a parameter to a different value, for example, to a session variable content.
i am trying to create connection using OLEDB connection in my app. but i am not able to create the connection as in datasource i want to use Server.mappath, but cudn't find the right method to use it. i am trying to make connection with Access database file. following is code i have tried:
string path = Server.MapPath("~/uploadaccess/Production.mdb"); string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("~/uploadaccess/Production.mdb")&";"; and also OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & path&";"); and tried this OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("~/uploadaccess/Production.mdb"));
and this is the error i am getting:
Operator '&' cannot be applied to operands of type 'string' and 'string'
I have 3 Databases that I am pulling data from for my web site. 2 of the databases are in the same SQL instance, however the 3rd one is in a different SQL instance. Both of the SQL instances are installed on the same server, one of them is a Named instance and the other is installed under the default instance. So my connection strings look something like this:
I'm in the process of moving this application from the Development Server to the Production Server when I noticed this issue. Previously the ABC and BCD connectionStrings where pointing to a different server and instance. So my question is how do I get this wo work with the server names being the same but the instances being different?
i m running asp.net example code in my vs 2005. I am using following datasource. I have no sql express edition, but i have developer edition of sql server 2005.
[code]...
i have .mdf file and i got 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)