Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General » SQL Server »

error

Estas en el tema de error en el foro de SQL Server en Foros del Web. hola que tal ? estoy intentando insertar fotos en una base de datos y me sale el sig. error: Server Error in '/login' Application. An ...
  #1 (permalink)  
Antiguo 26/10/2006, 14:48
 
Fecha de Ingreso: agosto-2006
Mensajes: 12
Antigüedad: 17 años, 8 meses
Puntos: 0
error

hola que tal ? estoy intentando insertar fotos en una base de datos y me sale el sig. error:

Server Error in '/login' Application.

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 88: com.Parameters.Add("@transaccion", SqlDbType.NVarChar, 50, "transaccion");
Line 89: adap.InsertCommand = com;
Line 90: adap.Update(tblim);
Line 91: }
Line 92: protected void Button1_Click(object sender, EventArgs e)

Source File: c:\Documents and Settings\PC\Mis documentos\Visual Studio 2005\WebSites\login\FileUpload.aspx.cs Line: 90

el codigo del proceso para insertar es :

protected void Insertar_Tabla(string nom, byte[] fo, string tipoInm, string zon, string transac)
{
SqlConnection micon = new SqlConnection();
SqlDataAdapter adap = new SqlDataAdapter();
micon.ConnectionString =
"Data Source=./SQLEXPRESS;AttachDbFilename=C:/Documents and Settings/PC/Mis documentos/Visual Studio 2005/WebSites/Borelli/App_Data/propiedades.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;Context Connection=False";
DataSet1.imagenesDataTable tblim = new DataSet1.imagenesDataTable();
DataRow filaim = tblim.NewRow();
filaim.BeginEdit();
filaim["nombre"] = nom;
filaim["foto"] = fo;
filaim["tipoInmueble"] = tipoInm;
filaim["zona"] = zon;
filaim["transaccion"] = transac;
filaim.EndEdit();
tblim.Rows.Add(filaim);
SqlCommand com = new SqlCommand();
com.Connection = micon;
com.CommandText =
"INSERT INTO imagenes VALUES (@nombre, @foto, @tipoInmueble, @zona, @transaccion)";
com.Parameters.Add("@nombre", SqlDbType.NVarChar, 50, "nombre");
com.Parameters.Add("@foto", SqlDbType.Image, 500, "foto");
com.Parameters.Add("@tipoInmueble", SqlDbType.NVarChar, 50, "tipoInmueble");
com.Parameters.Add("@zona", SqlDbType.NVarChar, 50, "zona");
com.Parameters.Add("@transaccion", SqlDbType.NVarChar, 50, "transaccion");
adap.InsertCommand = com;
adap.Update(tblim);
}

gracias
  #2 (permalink)  
Antiguo 26/10/2006, 16:48
Avatar de Developer9
(Desactivado)
 
Fecha de Ingreso: abril-2005
Ubicación: Mi Ecuador del alma
Mensajes: 4.196
Antigüedad: 19 años
Puntos: 47
Cual es tu string de conexion?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:07.