|
Hi Dominic, thank your for your response. I've had a look into the TOC on Amazon and it's not really what I'm looking for but I might buy it anyway So thanks for the tip!
Sebastian
|
|
|
|
|
|
protected void btnEdit_Click(object sender, EventArgs e)
{
try
{
GridViewRow row = ((LinkButton)sender).Parent.Parent as GridViewRow;
HiddenField vId = (HiddenField)gvUser.Rows[row.RowIndex].FindControl("hdPK");
form obj = new form(cmscon.CONNECTIONSTRING, Convert.ToInt32(vId.Value));
GetValue(obj);
Label1.Text = "";
lblError.InnerHtml = "";
}
catch (Exception ex)
{
}
}
<asp:TemplateField HeaderText="Action">
<ItemTemplate>
<asp:HiddenField ID="hdPK" runat="server" Value='<%# Eval("Id") %>' />
<asp:LinkButton ID="btnEdit" runat="server" OnClick="btnEdit_Click" CausesValidation="false">Edit</asp:LinkButton>
<asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return show_confirm();"
OnClick="btnDelete_Click">Delete</asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
|
|
|
|
|
This looks like ASP.NET, please use the correct forum.
|
|
|
|
|
You'll need to define "not working", but you can simplify that event handler code slightly:
GridViewRow row = (GridViewRow)((Control)sender).NamingContainer;
HiddenField vId = (HiddenField)row.FindControl("hdPK");
Also, remove the try..catch block, which is swallowing any exceptions and makes it much harder to see what the problem is.
|
|
|
|
|
So, Im writing a Forms application, an I am using the Validating event on some TextBoxes (setting e.Cancel = true if bad input). It works just fine until I click the red x in order to exit the application. If a textbox with faulty text has the focus then, the Validating event runs and makes the application not exit. What can I do about it?
|
|
|
|
|
Set a flag in the Closing event and check the flag for being set in the Validating events.
|
|
|
|
|
Doesnt work. The Validating event on the TextBox sets off before the FormClosing event.
|
|
|
|
|
|
Thanks, that article is exactly what I experience. Though the trick with the FormClosing event didnt really do it for me. The application does exit, but not until my MessageBox is sprung from the Validating event.
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = false;
}
What did work the way I intended (the application exiting without any validating), was the WndProc override.
private const int WM_CLOSE = 0x0010;
...
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_CLOSE)
AutoValidate = AutoValidate.Disable;
base.WndProc(ref m);
}
Great work!
|
|
|
|
|
|
hi
two days age i start visual basic.net and i know basic syntax of java and c++ very well now i want to see whole classes and methods of .NET Framework class libraries same like the documentation of java language so help me how to download the documentation
|
|
|
|
|
|
Just use the stuff on the web. You'd be downloading GIGABYTES worth of documentation.
|
|
|
|
|
hi there are ample of links on internet to download the documents for help
hi
|
|
|
|
|
Utterly worthless considering the Help 2.0 engine will download all the documentation for you, IF you wanted to waste that much hard drive space.
|
|
|
|
|
hi guys,,,
i want to retrieve data from view that include multiple tables & relations i used sql statment but it show exception telling that (Invalid column name 'DateFile'. )
here's my code :
public static DataTable GetFlightsByDate(DateTime datefile)
{
DataTable GetFlights=new DataTable();
string query = "SELECT TOP (20) Pax_No, Chd_no,"+
"Hotel_Id, DateFile, DEST, DEST_D, TypeTransfer, ARR_FLT, AT_Arr, DEP_FLT"+
"FROM V_Report_Rooming_List_Trsf where DateFile=@DateFile";
SqlConnection con = new SqlConnection(conn);
SqlCommand cmd = new SqlCommand(query, con);
cmd.Parameters.Add(new SqlParameter("@DateFile",datefile));
SqlDataAdapter sdr = new SqlDataAdapter(cmd);
sdr.Fill(GetFlights);
return GetFlights;
}
V_Report_Rooming_List_Trsf is a view in my database & the exception it shows
Invalid column name 'DateFile'.
Invalid column name 'Pax_No'.
Invalid column name 'Chd_no'.
i was working with mvc first & i thought it was mvc problem so i used asp.net but the i face the same problem
plzzz give me a solution my company wants me to finish this task very soon
modified 16-Jan-15 14:00pm.
|
|
|
|
|
Check the correct spelling of your column names.
|
|
|
|
|
eso0o wrote: Invalid column name 'DateFile'. It actually means exactly what it says. That is not a valid column. So, it must not be in V_Report_Rooming_List_Trsf.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
the problem solved after i put dbo.(view name) i could't believe that was the problem
thanks for uru replies
|
|
|
|
|
Ah yes. I hate that problem.
Glad to see you got it though.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Visual Studio 2010 VB using the VS Setup and Deploy to create an MSI install file.
2 Similar programs uninstalling each other.
We had a program running for a few years. We needed a similar program so we decided to use it a base. So The Program 1 folder was copied to create the Program 2 folder. Renames were done on the folder names and main modules. SLN file changed. The GUID in the Assembly info was changed.
We can install either but when we install program 2 from the IDE it first uninstalls program 1. Same when we install Program 1 it uninstalls program 2.
When we install them they both appear with the correct name in Control Panel programs but one or the other.
I understand something got crossed but what?
How can we fix it?
Thanks
|
|
|
|
|
Most likely the Product Code got duplicated from the first to the second setup. Each installer must have a unique Product Code which is a GUID.
I can't help you find it in Visual Studio, though, because I never use those setup projects. I use InstallShield.
Try looking for the Product Code and change it in the second setup.
NOTE: The Upgrade Code must also be unique for a separate product installer. If product 2 is only an upgrade of product 1, then the Upgrade Codes should be the same, otherwise they should be different.
The difficult we do right away...
...the impossible takes slightly longer.
modified 11-Jan-15 17:55pm.
|
|
|
|
|
I have changed the Guid in the Assembly. I do not know where else to look.
I have done this with several other programs and this is the only one giving us trouble.
|
|
|
|
|
You need to change the ProductCode in the install. The GUID in the Assmebly (whichever GUID you're talking about) means nothing to the installer.
I also never use the VS setup project, instead going for InstallShield.
|
|
|
|