Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Guest Ricardo Nepomuceno

Inserir No Banco Com Asp.net

Question

Guest Ricardo Nepomuceno

olá pessoal fiz o código abaixo e não da erro mas não insere nada no banco

<%@ import Namespace="System.IO" %>

<%@ import namespace="System.data" %>

<%@ import namespace="System.data.oledb" %>

<script runat="server">

sub page_load(obj as object, e as eventargs)

'configura a conexão

dim objconn as new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=c:\ineput\wwwroot\aspnet.mdb")

'abre a conexão

dim objcmd as new oledbdataadapter ("insert into cadastro (nome,email) values ('Ricardo','[email protected]')", objconn)

end sub

</script>

Dados Cadastrados com sucesso

alguém sabe onde está o erro ?

abraços

Ricardo

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Da alguma mensagem de erro?

Verifique se a pasta aonde está o banco de dados tem permissão de escrita para o usuario ASPNET.

Ah, e só pra avisar, procure fechar a conexão no final do script pra evitar problemas.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Cloud Computing


  • Forum Statistics

    • Total Topics
      148105
    • Total Posts
      643381
×
×
  • Create New...