Jump to content

Backup de dados em tabela SDF de dados sql/textbox!


jcachado
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.