Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1-I have a database that stores various kinds of data
I want to work for the Extract of data from the database to the computer

i'm using database : sql server 2008 ,Microsoft Visual C# 2010 Express

I used this code did not work :(
2- How can the work of compression to the database sql server ??

C#
private void Button2_Click(object sender, EventArgs e)
            {

                try
                {

                    SaveFileDialog s = new SaveFileDialog();

                    s.FileName = "";

                    if (DataGridView1.Rows.Count == 0)
                    {
                        return;
                    }

                    DataGridView1.Focus();


                    s.FileName = DataGridView1[2, DataGridView1.CurrentRow.Index].Value.ToString();


                    s.Filter = "Files(*." + DataGridView1[4, DataGridView1.CurrentRow.Index].Value.ToString() + ")|*." + DataGridView1[4, DataGridView1.CurrentRow.Index].Value.ToString() + "";



                    if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {


                        MemoryStream sWriter = new MemoryStream((byte[])(DataTable1.Rows[DataGridView1.CurrentRow.Index]["Files"]), true);
                                      if (sWriter == null)
					{
					  Interaction.Beep();
					}
					return;
					
          
                   }

                   DataGridView1.ClearSelection();

                }
                catch (Exception ex)
                {

                    Button1.Enabled = true;
                    Button2.Enabled = true;
                    Button3.Enabled = true;
                    Button4.Enabled = true;

                    MessageBox.Show(ex.Message);
                }
					
            }

here full work in this link:
http://www.mediafire.com/?c629cqc43plxgi1[^]
Posted
Comments
leana88 29-Jan-12 13:01pm    
Is my question a difficult ?

30 views and no answer!
Dean Oliver 30-Jan-12 1:11am    
Your question is very open ended. You need to clarify a few things. What technology you want to use to call the data from the database. How you want it to be called. etc
leana88 30-Jan-12 3:06am    
I need to call any method of data
Just take a copy of the data from base to the computer
you can see the full code in the link

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900