using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.IO;
using System.Data.SqlClient;
public partial class UploadandViewPDF : System.Web.UI.Page
{
string strconn = ConfigurationManager.ConnectionStrings["cnnLocal"].ConnectionString;
string desc = "0";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
private void BindGrid()
{
try
{
SqlConnection con = new SqlConnection(strconn);
con.Open();
string str = "select * from emp";
SqlCommand cmdins = new SqlCommand(str);
cmdins.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("ShowGrid", con);
DataSet ds = new DataSet();
da.Fill(ds, "pdffiles");
GridView1.DataSource = ds;
GridView1.DataBind();
}
catch (Exception ex)
{
desc = ex.Message;
}
}
}
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved
Shanky11, if this helps please login to Mark As Answer. | Alert Moderator