do the following Steps:
Perform the following actions:
1.Uncheck the Auto-generate field
2.Use two BoundFields for UserName and Country
3.Set the Header Text and DataField (field name in database)
4.Use ImageField for the image and set DataImageUrlField = ImageFieldName (ColumnName)
5.Click OK
public partial class _Default : System.Web.UI.Page
{
SqlConnection conn = new SqlConnection();
protected void Page_Load(object sender, EventArgs e)
{
conn.ConnectionString
= "Data Source=MyServer; Integrated Security=True; database=test";
Load_GridData(); // call method below
}
void Load_GridData()
{
conn.Open(); // open the connection
SqlDataAdapter Sqa = new SqlDataAdapter("select * from picture", conn);
DataSet ds = new DataSet();
Sqa.Fill(ds); // fill the dataset
GridView1.DataSource = ds; // give data to GridView
GridView1.DataBind();
conn.Close();
}
}
Hope this will help..
Let me know any questions..
Regards
Sriram.R
sriram
Vanamalisowjanya, if this helps please login to Mark As Answer. | Alert Moderator