|
Hi
I am getting this error "Internet explorer can not open the internet site. Operation aborted." whenever i try to update my contents on some pages. On that page i am using Google map API.So plz do the needfull
|
|
|
|
|
first i make a gridview it is visible when i made some changes in it,it hides. it visible property is true.plz help
|
|
|
|
|
you have to write your bind coding inside postback or after the (some changes)event. So the reason for grid view not visible is the gridview bind method is not called....
|
|
|
|
|
|
can you please send the code....
|
|
|
|
|
Yea,I also think this might be binding issue.Post your code so that problem can be actually find.
himanshu
|
|
|
|
|
public partial class Default2 : System.Web.UI.Page
{
SqlConnection cnx = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|Coupon Management.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
SqlDataAdapter da1 = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand();
DataTable dataTable;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FillVendorGrid();
}
}
private void FillVendorGrid()
{
dataTable = new DataTable();
cmd.Connection = cnx;
cmd.CommandText = "SELECT CouponType.CouponName, Coupon_Info.Coupon_TypeID FROM CouponType INNER JOIN Coupon_Info ON CouponType.CouponTypeID = Coupon_Info.Coupon_TypeID";
da1 = new SqlDataAdapter(cmd);
da1.Fill(dataTable);
GridView1.DataSource = dataTable;
GridView1.DataSourceID = String.Empty;
}
protected void ResultGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
FillVendorGrid();
}
protected void deleting(object sender, GridViewDeleteEventArgs e)
{
cmd.Connection = cnx;
cmd.CommandText = "DELETE FROM Coupon_Info WHERE RecievingDate='" + GridView1.DataKeys[e.RowIndex][0] + "'";
cnx.Open();
cmd.ExecuteNonQuery();
cnx.Close();
FillVendorGrid();
}
}
and this is asp code
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateSelectButton="True" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None" onrowdeleting="deleting"
style="z-index: 4; top: 425px; left: 280px; position: absolute; height: 312px; width: 691px">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Coupon" HeaderText="Coupon"
SortExpression="Coupon" />
<asp:BoundField DataField="Serial Start" HeaderText="Serial Start"
SortExpression="Serial Start" />
<asp:BoundField DataField="Serial End" HeaderText="Serial End"
SortExpression="Serial End" />
<asp:BoundField DataField="Recieved By" HeaderText="Recieved By"
SortExpression="Recieved By" />
</Columns>
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
|
|
|
|
|
haleemasher wrote: GridView1.DataSource = dataTable; GridView1.DataSourceID = String.Empty;
i dono where the error is... but try to include
private void FillVendorGrid()
{
dataTable = new DataTable();
cmd.Connection = cnx;
cmd.CommandText = "SELECT CouponType.CouponName, Coupon_Info.Coupon_TypeID FROM CouponType INNER JOIN Coupon_Info ON CouponType.CouponTypeID = Coupon_Info.Coupon_TypeID";
da1 = new SqlDataAdapter(cmd);
da1.Fill(dataTable);
GridView1.DataSource = dataTable;
GridView1.DataBind();
}
|
|
|
|
|
thnx 4 help but it doesn't work
|
|
|
|
|
Hi,
As you mention in original post when i made some changes in it.What changes you have made??If it is some kind of database operation make sure datable is filling or not..
himanshu
|
|
|
|
|
changes like change color of gridview not in data source or database
|
|
|
|
|
haleemasher wrote: changes like change color of gridview
where is the code for that.... in which you you are writing the code for color change...
|
|
|
|
|
In your .aspx code - you give the "DataSourceID="SqlDataSource1"" - r u bind with this sqldatasource in aspx page, where is that code ?Post your full code with Sqldatasource.
|
|
|
|
|
SqlConnection cnx = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|Coupon Management.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
SqlDataAdapter da1 = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommand cmd = new SqlCommand();
DataTable dataTable;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FillVendorGrid();
}
}
private void FillVendorGrid()
{
dataTable = new DataTable();
cmd.Connection = cnx;
cmd.CommandText = "SELECT CouponType.CouponName, Coupon_Info.Coupon_TypeID FROM CouponType INNER JOIN Coupon_Info ON CouponType.CouponTypeID = Coupon_Info.Coupon_TypeID";
da1 = new SqlDataAdapter(cmd);
da1.Fill(dataTable);
GridView1.DataSource = dataTable;
GridView1.DataSourceID = String.Empty;
}
protected void ResultGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
FillVendorGrid();
} protected void deleting(object sender, GridViewDeleteEventArgs e)
{
cmd.Connection = cnx;
cmd.CommandText = "DELETE FROM Coupon_Info WHERE RecievingDate='" + GridView1.DataKeys[e.RowIndex][0] + "'";
cnx.Open();
cmd.ExecuteNonQuery();
cnx.Close();
FillVendorGrid();
}
and asp code is
asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString2 %>"
SelectCommand="SELECT CouponType.CouponName, Coupon_Info.Coupon_TypeID FROM CouponType INNER JOIN Coupon_Info ON CouponType.CouponTypeID = Coupon_Info.Coupon_TypeID"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateSelectButton="True" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None" onrowdeleting="deleting"
style="z-index: 4; top: 425px; left: 280px; position: absolute; height: 312px; width: 691px">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Coupon" HeaderText="Coupon"
SortExpression="Coupon" />
<asp:BoundField DataField="Serial Start" HeaderText="Serial Start"
SortExpression="Serial Start" />
<asp:BoundField DataField="Serial End" HeaderText="Serial End"
SortExpression="Serial End" />
<asp:BoundField DataField="Recieved By" HeaderText="Recieved By"
SortExpression="Recieved By" />
</Columns>
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
|
|
|
|
|
i think code is perfect, but change the datasource id, i.e
asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString2 %>"
Here your are giving id="SqlDataSource2"
but in grid your are using "DataSourceID="SqlDataSource1" "
|
|
|
|
|
haleemasher wrote: asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString2 %>"
haleemasher wrote: AutoGenerateSelectButton="True" CellPadding="4" DataSourceID="SqlDataSource1"
use the correct datasource...
|
|
|
|
|
i change the error that u have mention but it still not working
|
|
|
|
|
|
N Ahmed wrote: I am new in the forum
Then you should read How to get an answer to your question above first
only two letters away from being an asset
|
|
|
|
|
You seem to be saying that you've run out of money and want someone to finish your site for free. Not going to happen, sorry. muslimdirectory sounds like the sort of site where you may find someone with a vested interest to help you for free, but this site is for people who know how to program and have specific questions.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Good day
I'm making a registration form for my web site and need to develope that "security code generator" (which generates a sting and asks the user to write it in one of the registration form's fields). I've googled it but unfotunately i just can't find the right thing i'm searching for. Can you please help me ?
Regards, Hris
|
|
|
|
|
Captcha is what it is called. Go google again :P
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Sometimes i just don't know what to google ......
Thank you.
|
|
|
|
|
Yeah, knowing what to google is the hard bit.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|