Click here to Skip to main content
15,912,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;
namespace photoshops
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        SqlConnection conn = new SqlConnection();
        protected void Page_Load(object sender, EventArgs e)
        {
            conn.ConnectionString
              = @"Data Source=DEVI\SQLEXPRESS; Initial Catalog =cat; Integrated Security=SSPI";
            Load_GridData(); // call method below
        }
        void Load_GridData()
        {
            conn.Open(); // open the connection 
            SqlDataAdapter Sqa = new SqlDataAdapter("select * from tblphotosettings", conn);
            DataSet ds = new DataSet();
            Sqa.Fill(ds);  // fill the dataset 
            GridView1.DataSource = ds.Tables[0]; // give data to GridView
            conn.Close();
        }
    }
}
i have enter a textbox in customer bill number and then click the button display image customer record in a gridview.... How to change in my code.. because i am begineer... can you post the code
Posted
Updated 15-Apr-11 0:27am
v2

Check your page definition: somewhere in your definition of GridView1 you have
DataSourceID="String"
Either remove it, or remove the Load_GridData call from you Page_load method.
 
Share this answer
 
Comments
kannan 2 14-Apr-11 3:20am    
can you post code
OriginalGriff 14-Apr-11 3:42am    
How do I post the code for you removing something from your file?
Sandeep Mewara 14-Apr-11 5:16am    
There is one more issue! Posted it.
Oops! wrong place! :)

BTW, please help him... ;)
OriginalGriff 14-Apr-11 5:48am    
Codez to remove code? Ah! I know: "FORMAT C: /S" :laugh:
Sandeep Mewara 14-Apr-11 5:54am    
That was quick... I thought you would take some time before giving this to OP! :doh:

:P
Remove DataSourceID attribute from GridView1 definition
 
Share this answer
 
This discussion[^] should help you out.
 
Share this answer
 
Comments
kannan 2 14-Apr-11 3:18am    
i am beginner

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