Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Luiz-Filipi

ASP.NET + SQL server 2005

Recommended Posts

eae galeraaaa ..!!

 

venhuu akii peddiirrr mto a ajuda de você´s .!

 

esperoo que consiguam me ajudarr ..!!

 

tenhuuu um insert em asp.net para um BD server 2005 ..!!

 

como sou leigoo no assunto nao esta dandoo certoo ..!!

 

segue os codigoss e erros ..

 

desde já agradeçoo galeraa ..!!

 

 

:wacko:

<%
    Dim ConectaSQL
    [u]ConectaSQL = Server.CreateObject("ADODB.Connection")[/u]aki estaaa o erroo ..!! 
    ConectaSQL.Open(New Data.SqlClient.SqlConnection("server=WESTBRSRVDESENV\SQL2005;uid=usr_solicitacao;pwd=pwd_solicitacao;database=solicitacao"))
    ConectaSQL.Open()

        Dim NOME, SENHA
        
    NOME = Request.Form("NOME")
        SENHA = Request.Form("SENHA")

Dim Insert

        Insert = "INSERT INTO  login (NOME, SENHA) VALUES('" & nome & "','" & SENHA & "')"
ConectaSQL.Execute(Insert)


    ConectaSQL.close()

    %>    


 

este é o errooo ..!!

 

 

Server Error in '/asp.net' Application.
--------------------------------------------------------------------------------

The component 'ADODB.Connection' cannot be created.  Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive. 
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.Web.HttpException: The component 'ADODB.Connection' cannot be created.  Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive.

Source Error: 


Line 1:  <%
Line 2:      Dim ConectaSQL
Line 3:      ConectaSQL = Server.CreateObject("ADODB.Connection")
Line 4:      ConectaSQL.Open(New Data.SqlClient.SqlConnection("server=WESTBRSRVDESENV\SQL2005;uid=usr_solicitacao;pwd=pwd_solicitacao;database=solicitacao"))
Line 5:      ConectaSQL.Open()
 

Source File: C:\sistemafelipe\asp.net\inserir.aspx    Line: 3 

Stack Trace: 


[HttpException (0x80004005): The component 'ADODB.Connection' cannot be created.  Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive.]
   System.Web.Util.AspCompatApplicationStep.CheckThreadingModel(String progidDisplayName, Guid clsid) +857313
   System.Web.HttpServerUtility.CreateObject(String progID) +103
   ASP.inserir_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in C:\sistemafelipe\asp.net\inserir.aspx:3
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558

 

 

 

vlww pela atençaaoooo ai galeraaaa http://forum.imasters.com.br/public/style_emoticons/default/clap.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

Movido Plataforma .NET http://forum.imasters.com.br/public/style_emoticons/default/seta.gif Plataforma .NET » Web Applications

 

Essa linha veio do asp. Nem precisa dela, de uma olhada nesse artigo: http://www.macoratti.net/websrv2.htm

 

Abraços...

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.