asp.net - mdf file and connection error -


i m running asp.net example code in vs 2005. using following datasource. have no sql express edition, have developer edition of sql server 2005.

<asp:sqldatasource     id="srcfiles"     connectionstring="server=.\sqlexpress;integrated security=true;         attachdbfilename=|datadirectory|filesdb.mdf;user instance=true"     selectcommand="select id,filename files"     insertcommand="insert files (filename,filebytes) values (@filename,@filebytes)"     runat="server">     <insertparameters>         <asp:controlparameter name="filename" controlid="upfile" propertyname="filename" />         <asp:controlparameter name="filebytes" controlid="upfile" propertyname="filebytes" />     </insertparameters> </asp:sqldatasource> 

i have .mdf file , got following error message.

a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified)

please me.

you need change connection string. try changing connection string (put in database name) if doesn't work we'll need more information you:

connectionstring="server=.;integrated security=true;initial catalog=yourdatabasenamehere" 

do know if sql server 2005 install default instance or named instance? if don't know it's default can find out sure if needed.

hopefully know name of database, otherwise in trouble. :)

lastly, running local windows administrator account? if so, should able sql server easily. if not, might need tweak security bit.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -