|
Hi All,
I have some records stored sql 2000 server.
want to display a particular members record....and want to give option for members to edit and update their Records by using a datalist.....am using VS2000 and asp.net with c#(.NET1.1)......Kindly help me to solve my problem...
Thanks in advance
Bijesh
|
|
|
|
|
|
|
Hey All,
I have an app that is requesting and scraping a static html page and have just realised that the machine that it is going to be hosted on is running the site under medium trust (which is not negotiable). So now i have a whole lot of scraping stuff happening, but can no longer make the http request without a security exception on the production server.
The current code making the request is:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
HttpWebResponse response;
try{
response = (HttpWebResponse)request.GetResponse();
}
catch(Exception ex){
throw new InvalidOperationException("Could not retrieve requested page.",ex);
}
....then reading the stream in and putting into a string for use.
Does anyone know of a way to make a request for a static html page on another site without running into security problems?
Thanks
|
|
|
|
|
Good day everybody...
I am facing this problem I tried to solve it, but I couldn't. I tried to selete some parameters and add , but all my tries failed. If any body could help me with it.
"ObjectDataSource 'ODSIPAddress' could not find a non-generic method 'UpdateQuery' that has parameters: OrgCode, Original_OrgCode, original_IPAddress."
Thanks a lot.
|
|
|
|
|
constring = System.Configuration.ConfigurationManager.AppSettings["conString"];
con = new SqlConnection(constring);
Label Label1 = (Label)GridView1.Rows[e.RowIndex].Cells[0].FindControl("Label1");
TextBox txtFname = (TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("txtFname");
TextBox txtLname = (TextBox)GridView1.Rows[e.RowIndex].Cells[2].FindControl("txtLname");
TextBox txtAddress = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].FindControl("txtAddress");
TextBox txtPhone = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].FindControl("txtPhone");
cmd = new SqlCommand("Update Employee set(Fname,Lname,Address,Phone)values(@Fname,@Lname,@Address,@Phone)",con);
cmd.Parameters.AddWithValue("@Fname",txtFname.Text);
cmd.Parameters.AddWithValue("@Lname", txtLname.Text);
cmd.Parameters.AddWithValue("@Address", txtAddress.Text);
cmd.Parameters.AddWithValue("@Phone", txtPhone.Text);
con.Open();
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (dr.Read())
lblmsg.Text = "Record has been successfully updated";
else
lblmsg.Text = "";
con.Close();
|
|
|
|
|
Thanks for your reply.
However, how about if I want to do it by using the proprity that is built in ASP.Net. I tried my query inside SQL server and it is working right, but when I am using it by binding it withthe GridView it does not work. Either it give me an error or it run without error, but it doesn't update.
Looking for an answer.
|
|
|
|
|
Hi,
Previously I was working on Asp.net 1.0 with vb.net. Now I am working on asp.net 2.0 with C#. I am confused about how to use GridView in asp.net 2.0.
What is the syntax for that.
Can any one send me sample code for Gridview with EDIT,DELETE,SELECT etc.
Thank in advance!
|
|
|
|
|
www.google.com
Make sure you put the dots in all the right places.
Seriously though...
Go to http://www.asp.net[^] and click the "Learn link at the top of the page. On the next page you see, you'll see HUNDREDS of .Net tutorials.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I am using the following code to delibarately generate an error on a page:
Dim exNew As Exception = New Exception("This is a phony exception")
Throw exNew
On the page's error event, I use Server.Transfer("../errorHandler.aspx") to pass error handling on to a custom error notification page (see below). If I handle the error at page level, all works fine and I get the error message "This is a phony exception" as expected.
However, if I change error handling to application level (again just using Server.Transfer in the Application_Error sub in global.asax), the custom error notification page displays again, but this time the message is "Exception of type 'System.Web.HttpUnhandledException' was thrown."
I have a feeling this has something to do with the customErrors tag in web.config as it was all fine until I modified this, currently set to:
<customErrors mode="RemoteOnly" defaultRedirect="../errorHandler.aspx"/>
Can anyone shed any light on this? Have been playing around with it but just can't get it to work...
The error notification page code is:
Protected Function errorDetails(ByVal emailLog As Boolean, ByVal emailToAddress As String, ByVal emailFromAddress As String, ByVal emailAppName As String) As String
' Declarations
Dim unhandledException As Exception = _
Server.GetLastError
Dim errorDateTime As String = Now().ToString
Dim errorLog As String
Dim lineBreak As String = Chr(13) & Chr(10)
Dim currentLog As String
' Returns error message for output on page
errorDetails = "<p>" _
+ "<strong>Date/Time: </strong>" + errorDateTime _
+ "<br /><strong>Message: </strong>" + unhandledException.Message.ToString() _
+ "</p>"
' Generates error log for email/text file
errorLog = "Date/Time: " + errorDateTime _
+ lineBreak + "Message: " + unhandledException.Message.ToString() _
+ lineBreak + "Source: " + unhandledException.Source.ToString() _
+ lineBreak + "Target Site: " + unhandledException.TargetSite.ToString() _
+ lineBreak + "Stack Trace: " + unhandledException.StackTrace.ToString()
' Emails log
If emailLog Then
Emailer.Send(emailToAddress, emailFromAddress, "Website Error Notification from: " & emailAppName, errorLog)
End If
' Gets existing error log from text file
Dim fsIn As FileStream = File.OpenRead(Server.MapPath("../ErrorLog.txt"))
Dim sr As StreamReader = New StreamReader(fsIn)
currentLog = sr.ReadToEnd.ToString()
sr.Close()
' Writes error log to text file
Dim fsOut As FileStream = File.OpenWrite(Server.MapPath("../ErrorLog.txt"))
Dim sw As StreamWriter = New StreamWriter(fsOut)
sw.WriteLine(currentLog + errorLog)
sw.WriteLine(lineBreak + "***********************************************" _
+ lineBreak)
sw.Flush()
sw.Close()
' Clears error from server
Server.ClearError()
End Function
|
|
|
|
|
Hi, I have deployed my asp.net applications to a remote server by using FTP. All aspx pages worked fine on my computer but they ceased to to work when deployed to a remote server. All aspx pages stopped working, except for the html pages. The error message I get was "The current custom error settings for this application prevent the details of the application error from being viewed remotely". What could be the cause of this problem? Please help me resolve this problem, thank you in advance for your help.
|
|
|
|
|
Your core problem is that the web.config is setup for remote clients to not see debug errors, which is good, but unless you can test it directly on the server, you need to change it, to find out what the actual error is.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
can we have more than one sitemap ina project?
if yes how?
how can we display just a part of a site map by a menu?
|
|
|
|
|
I have a dropdownlist control that I want to populate via a function in the code behind. I'm using a a table adapter to actuyally retrieve the fdata, (and when I "previewData", the expected data is displayed. This is what I have so far:
(userType is the dropdownlist control on the aspx page)
STAFFTYPESTableAdapter adapter = new STAFFTYPESTableAdapter();
userType.DataSource = adapter.GetStaffTypes();
All of the items in the dropdown read as follows:
System.Data.DataRowView
There are exactly n occurrences, where n is the number of records in the table. In other words, there are 7 records I expect to see, and there are 7 entries in the dropdown list.
The table I'm retrieving contains two fields - a numeric ID and a text description. What am I doing wrong?
Before you suggest letting the form handle it, I don't want to do it that way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
All items are showing like that in dropdown???
John Simmons / outlaw programmer wrote: System.Data.DataRowView
It is because you didn't specify the DataValueField and DataTextField.
<br />
DropDownList1.DataSource = ds.Table[0];<br />
DropDownList1.DataValueField = "id";<br />
DropDownList1.DataTextField = "description";<br />
DropDownList1.DataBind();
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Ahhhh. Many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: The table I'm retrieving contains two fields - a numeric ID and a text description. What am I doing wrong?
It's exactly what Michael said. You didn't specify which field to show, so what can the dropdown do? Call .ToString(), and that's exactly what's happening.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
dnh wrote: It's exactly what Michael said.
So why respond?
only two letters away from being an asset
|
|
|
|
|
If you cared to read past first sentence you would see I explained WHAT and WHY is John seeing.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Still an unnecessary response. Thanks for the 1, give me another so I can have 2.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: unnecessary response.
Ok if you say so, I'll resist my urge to explain something next time. By the way, I am catching up on you in unnecessary responses... now we both have two in this thread :P
Mark Nischalke wrote: Thanks for the 1, give me another so I can have 2
You didn't ask stupid (from my POV) question this time, but expressed you opinion. Why should I?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
How to set CSS class to tbody of GridView? When I set the css class in Row-Style property, all rows have been set with this style which is I don't want. I found the way to set CSS class in thead and tfooter of GridView. but not for tbody. Is it possible to do with CSS adapter or normal way?
For example
If I wrote the code like that,
HTML View
<asp:GridView ID="GridView1" runat="server" > <br />
</asp:GridView><br />
Code-behinded File
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
List<string> list = new List<string>();<br />
list.Add("Alien");<br />
<br />
GridView1.DataSource = list;<br />
GridView1.DataBind(); <br />
<br />
}<br />
the HTML tag will be generated as fellows by default ~
<table cellspacing="0" rules="all" border="1" id="GridView1" style="border-collapse:collapse;"><br />
<tr><br />
<td>Alien</td><br />
</tr><br />
</table><br />
I noticed that there is no thead or tbody or tfoot in the generated HTML table. I want GridView to generate the HTML table with those tags. So, I tried with the follwing code.
<br />
grid.UseAccessibleHeader = true;<br />
<br />
grid.HeaderRow.TableSection = TableRowSection.TableHeader;<br />
grid.HeaderRow.CssClass = "fixedHeader";<br />
<br />
grid.FooterRow.TableSection = TableRowSection.TableFooter;<br />
<br />
then, I can add thead, tbody and tfoot to generated HTML successfully. It allows me to set the custom CSS class by using HeaderRow.CssClass and FooterRow.CssClass properties. But I found no way to specify the custom CSS class for tbody. So, it would be great if anyone tell me to achieve this goal.
Thanks in advance.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Yeah. It can be done with ASP.NET 2.0 CSS Friendly Control Adapters 1.0
Check-out here if you want the sample for that.
Hope it helps for everybody..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
After I installed my web application on the server,please I had an error when I wanted to generate a report that I designed with visual studio 2003 crystal report.
The error is "Keycode.dll missing or keycode is invalid" this report is from crystaldecision engine. But if I generate the report on the pc I used to develop the web application it will display. Please how can I solve this.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
hi
in my webForm i have a gridView and FormView and bind both objects to SqlDataSource1(GridView for select,delete and FormView for Update), in my webForm
when user select a row in GridView, it show all details fields in FormView for editing, but when i edit my record in formView and click on Update link, nothing occured.
how to solve my problem ?
note 1 : when i click on Delete link in GridView, current record delete from gridView successfully.
note 2 : my delete and update commands is StoredProcedure and set it in my SqlDataSource1.
|
|
|
|