Skip to content

C# and sql server database

Maniraguha Jean Paul

Asked Mar 17, 2014, 11:14 PM EDT1 answer
Share
LinkedInX
I have a question, How can i search a record  from sql server database using an other form ?
 
How can i update an image in the sql server database?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
      Hi Maniraguha,

    Below Code May help you for searching data from sql

    SqlConnection SCC=new SqlConnection("connection string");
    SqlCommand CCommand = new SqlCommand();
                        CCommand.Connection = SCC;
                        CCommand.CommandType = CommandType.Text;
                        CCommand.CommandText = "select * from tablename where ColumnName='" + Search Value+ ";
                        DataTable dt = new DataTable();
                        SqlDataAdapter sda = new SqlDataAdapter();
                        sda.SelectCommand = CCommand;
                        sda.Fill(dt);

    and below link will help you to for update image

    http://www.c-sharpcorner.com/Blogs/11000/upload-a-file-using-fileupload-using-Asp-Net.aspx

    if above are help full to you kindly mark as answer
    0