|
Hi,
I'm sure there must be an easy way of doing this, but assuming I've connected to a specific web service, how can I get the connected web service's URL?
Obviously I've set the reference when I've built my project and I could get the setting but I just think there must be a way of verifying from the web service itself, where it's being served from.
Thanks
|
|
|
|
|
There's the URL or Address property (I'm not sure about that). However, what are you exactly trying to achieve?
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
there are many ways to check server is up or not or the URL exists, like HttpWwebRequest , Ping
Nobody is perfect i'm Nobody
|
|
|
|
|
hi all,
i am using ASP.net 2003.
i want to print the content of a datagrid in a webform.
the datagrid conatin nearly 10 pages with page size 20.
how can i print all pages in a single button click??
i know to print the content in a div tag.Line feeeding is not working in this also.
wat should i do?
is der any reporting tool other than crystal reprot???
thanks in advance
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
My advice is to create a separate CSS file for media: print. You should configure the datagrid to display all rows at once instead of paging through it. It takes some fiddling, but that should work.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
hi,
Thanks for the reply.
sorry ,i didnt get this "My advice is to create a separate CSS file for media: print."
CSS file??
plz tell me in detail..
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Hi, I have posted this question before but the response was less than satisfactory. What does the following line of code actually do?
strSQL = String.Format("SELECT UserName FROM MembersInfotbl WHERE (email='{0}');", txtUserName.Text)
I had done some search on String.Format and some of the sites I visited said that the 1st value within the parentheses serves as the place holder for the 2nd value. So for example if k=String.Format( Page{0}, 1) the number 0 will be replaced by the 2nd number which is 1. That doesn't make sense when applied to the line above, because then email='{0}' would become email= txtUserName.text. Please correct me if I'm wrong. Thank you in advance for your help.
|
|
|
|
|
ASPnoob wrote: I had done some search on String.Format and some of the sites I visited said that the 1st value within the parentheses serves as the place holder for the 2nd value.
What you have got from the search is right.
But you have a small misunderstanding with that.
ASPnoob wrote: strSQL = String.Format("SELECT UserName FROM MembersInfotbl WHERE (email='{0}');", txtUserName.Text)
if the textbox has some value say XXX@YYY.COM, then
strSQL will be
SELECT UserName FROM MembersInfotbl WHERE (email='XXX@YYY.COM');
Regards,
Arun Kumar.A
|
|
|
|
|
The reason I was confused was because txtUserName.text is used for inputing a user's user name. The following was the code that I found for validating a user's Login.
Function DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer
Dim bResult As Boolean = False
Dim objConn As New OleDbConnection(ConfigurationSettings.AppSettings("myDB"))
Dim strSQL As String
Dim strGoodPassword As String
Dim objCommand As New OleDbCommand
objCommand.Connection = objConn
strSQL = String.Format("SELECT p_w FROM myDB WHERE (email='{0}');", txtUserName.text)
objCommand.CommandText = strSQL
objCommand.CommandType = CommandType.Text
objConn.Open()
strGoodPassword = CType(objCommand.ExecuteScalar, String)
objConn.Close()
If Not strGoodPassword Is Nothing Then
If strGoodPassword = strPassword Then
bResult = True
Else
lblMessage.Text = "Invalid Login!"
lblMessage.Text &= " If you are not a member please click the above link to register."
End If
Else
lblMessage.Text = "Invalid Login!"
lblMessage.Text &= " If you are not a member please click the above link to register."
End If
Return bResult
End Function
Could you please explain the role of strSQL in this code? I am confused as to why it was used like that. Thank you in advance for your help.
|
|
|
|
|
hi,
the purpose of strSQL is to store the sql command string, which in this case will retrieve the field p_w from the table myDB and whose email is equal to the email address provided by the user.
the string.format function simply replaces {0} with the string from the textbox - txtUserName, which the user provided.
the otput of this will be same as :
strSQL = "SELECT p_w FROM myDB WHERE (email='" & txtUserName.text & "');"
you need this string because it tells the command object what to fetch from the database.
hope this helps.
regards
|
|
|
|
|
Firstly, that appears to be a nasty bit of code. No wonder you're confused. If I were you I'd do some research, some learning & then rewrite it properly.
strSQL is being used here as an SQL Select statement[^] that retrieves data, in this case an email address, from a database (I'm guessing Access) using a Command Object[^].
Why is this code is bad? Here's a few reasons off the cuff - I'm giving you these (and a few links for your benefit) to point you in the right direction when you rewrite it
1. The function is being passed an argument (strUsername) that is never used.
2. There is no input validation being done on the email address in the SQL statement which opens the database up to SQL Injection[^].
3. There are no Try...Catch...Finally[^] blocks - standard practice when working with a database.
I shudder to think what the rest of this code looks like... Good luck.
|
|
|
|
|
I use Dundas charts and I get this error:
Access to the path 'C:\Inetpub\wwwroot\Project\Control\GaugePic_000006.png' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\Inetpub\wwwroot\Project\Control\GaugePic_000006.png' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
It says something about a security tab but I don't have a security tab.
|
|
|
|
|
Are you and Administrator? What version of Windows? What version of IIS?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hey buddy try following, after doing this security tab should start coming, if it still does not come, please reply back
[To Display the Security Tab: Start/Settings/Control Panel/Appearance & Themes/Folder Options. View/Advanced
and clear "Use Simple File Sharing".]
Now go to desired folder, right click on it and select Properties. you must be able to see security tab now.
Vikas Sharma
|
|
|
|
|
@vikasparth
It worked!
Thank you both!
|
|
|
|
|
How to Trap Key-Press for validating each digits in Text Box.
I want help for this with C# coding.
Its Amazing World of ASP.NET C#
|
|
|
|
|
Just validate everything at the end. Before you do anything with the data. If you were to hook on to keypress you would create way too many postbacks.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Try using javascript. This is how you should do......
TextBox1 txt=new TextBox();
txt.Attributes.Add("onkeypress","return ValidateForm(event)";
In javascript
function ValidateForm(e)
{
var unicode=e.charCode? e.charCode : e.keyCode //determine keycode
if ((unicode>=48&&unicode<=57)// Allow only numbers
return true;
else
return false;
}
|
|
|
|
|
Use a RegularExpression validator control with the RegEx "^\d$"
only two letters away from being an asset
|
|
|
|
|
|
I think you can put a semi column after one and start the next right after. What two types are you trying to do? Usually you can combine them.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Or you could just create two queries & call both in code one after the other.
|
|
|
|
|
Or create a stored procedure that can execute 2 queries.
Regards,
Arun Kumar.A
|
|
|
|
|
Thank for you taking ur time to help me
|
|
|
|
|
OnPreInit() and Init() wat is the difference..A control is intialized to its design defaults and postback data is not available in both cases then wat is the major difference between them..
LoadViewState and LoadPostBackData..i am really confused
protected override void LoadViewState(object savedState)
{
base.LoadViewState(savedState);
}
This event is never getting fired for me
if a textbox value is changed in a button click. Who is responsible for storing the textbox value.
what is diff b/w data stored in view state and data stored in a control that implements IPostBackDataHandler.
|
|
|
|