jcachado Posted October 26, 2015 at 11:33 AM Report Share #589144 Posted October 26, 2015 at 11:33 AM Bom dia, Tenho o seguinte código e pretendia incluir um botão para fazer o backup ou salvar novos dados um uma tabela entretanto criada back.sdf. Podem pf dar umas dicas de qual a melhor forma de o fazer? Muito obrigado desde já pela ajuda prestada! Private Sub Form_Planos_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim con As New Odbc.OdbcConnection("Dsn=informix_teste;DATABASE=system;host=exe;serv=onlinet;srvr=onlinet;pro=onsoctcp;uid=user;pwd=teste") Dim com As New Odbc.OdbcCommand("select ck_id ,wh_id,plan_id ,create_dtim from table1 where id='40'order by create_dtim desc", con) Dim da As New Odbc.OdbcDataAdapter(com) Dim dr As Odbc.OdbcDataReader con.Open() dr = com.ExecuteReader If dr.HasRows Then While dr.Read() TextBox1.Text = TextBox1.Text + dr("ck_id").ToString + Environment.NewLine TextBox2.Text = TextBox2.Text + dr("wh_id").ToString + Environment.NewLine TextBox3.Text = TextBox3.Text + dr("plan_id").ToString + Environment.NewLine TextBox4.Text = TextBox4.Text + dr("create_dtim").ToString + Environment.NewLine End While End If dr.Close() con.Close() End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub Link to comment Share on other sites More sharing options...
Cerzedelo Posted October 28, 2015 at 11:17 AM Report Share #589243 Posted October 28, 2015 at 11:17 AM A questão é pretende fazer um backup a BD, ou inserir novos registos numa tabela? Se utilizar os tableadapters , na barra na parte posterior, já tem la um botão com o sinal + para inserir novos registos. Caso contrario, ver: https://msdn.microsoft.com/en-us/library/ms233812.aspx http://www.macoratti.net/13/04/vbn_stor1. Já se pretende fazer backup a BD, ver: http://stackoverflow.com/questions/17785772/making-a-back-up-of-a-sql-server-compact-edition-corrupts-the-database Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now