|
Hi Prakash,
I don't exactly know if how to do this. It's like this...
Kindly open your ASP.Net WebSite Administration Tool, then goto Security Tab, then click link - Create User. Here you can see the different fields for the user to enter.
These are the default fields that will display - User Name, Password, Confirm Password, E-mail, Security Question, and Security Answer.
My problem is how to add a field next to User Name? Let's say I will going to add the Address field right next to User Name so that when I use the "CreateUserWizard" control the Address field will also be used.
I hope there's a sample of doing it
Thanks Prakash
hifiger2004
|
|
|
|
|
Hi!
i am having problem in window service that has to send an email using "System.Net.Mail.SmtpClient". the service code stops unexpectidly when email code runs, in the event log following entry is made:
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 6/21/2007
Time: 8:07:28 AM
User: N/A
Computer: xyz
Description:
EventType clr20r3, P1 ejadspmscheduler.exe, P2 1.0.0.0, P3 467a6ece, P4 ejadspmscheduler, P5 1.0.0.0, P6 467a6ece, P7 19, P8 1a13, P9 system.nullreferenceexception, P10 NIL.
The email is using network authentication, if we run service under "network service" then the execution stops at email code, and rest of code is never executed and service dose'nt terminates.
Kindly help me in solving this prbolem. also guide me if i posted this question in wrong forum..
Thanks in advance...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
First you should put a Try Catch around your email logic so you can catch the expection and log it and keep your windows service from going into a bad state. You can even choose to stop the service in the Catch code if that makes sense for you. Anyway, Usually with the mail componants you need a valid email address to be used to authenticate to the email server. Often you can do it from using the correct email address in the from address of your email address. Based off your error message I am guessing that you perhaps didn't even add a from address to the email message. If you want to post your email code we might be able to help more.
Hope that helps.
Ben
|
|
|
|
|
Hi!
Thanks for reply,
I have done extensive logging and debugging. the email code is b/w 4 nested try catch statements. but this exception is not cathed by try/catch block, it straight away blocks the application and exists.
i found that the service stops when email is to be sent to any email address that is not local (email account not on the server) like gmail,hotmail, etc. if email is to be sent to local email address it works fine.
any ideas? any kind of help or guidence is appriciated...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
I am pretty sure if you have a base exeception you should be able to catch this exeception. I am guessing that the email server you are trying to use needs some credientials that you are not passing it or doesn't allow email to be sent through it. I would create a simple windows app that has only your email code. Try to get the simple windows app to work with the email stuff first, then once you get it working copy the code into your windows service.
Ben
|
|
|
|
|
Thanks for reply,
i have already tried every thing you mentioned above, i turned on/off the credentials, tested the email code in separate application which was working fine there. but when i put it in window service it stops working.
any ideas whats the problem...? am i missing some thing?
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
If you got it working in a windows app, but it doesn't work in the windows service the only possibility is the user login you are running the windows service as. Try running the windows service as your login and I am guessing it will work. Which ever login you are using for your windows service (I think you said network service) it doesn't have the correct rights on the PC to do email. If your login works, you should be able to set up a new local or domain user account to run the windows service as. That is normally what I do when I use windows services.
Ben
|
|
|
|
|
Thanks for reply...
I am afraid this is also not the problem...! i am using my own local user account with full rights. if i must set some special account setting/rights then please guide me what to do?
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Have you tried running the windows service as your login? If your login works with the windows app, it should cause the windows service to work.
Ben
|
|
|
|
|
Thanks for reply,
I tried both window application and window service on local user account. one more thing just came to my notice that previously this was running fine but few days ago i changed some setting of SMTP to block spams and probably after that this problem startd to occure.
Do you think it is because of change in SMTP settings...? if yes then how can i reset the setting or enable window service to run on new setting?
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
So I think you are saying that your windows app doesn't work anymore. I am not sure how you changed your SMTP settings, so I am not sure how to reset them either. If that is what changed then that is most likely what needs to be fixed. Note if you are sending lots of emails to a certain server, you will get marked as a spammer which could also be your problem.
Ben
|
|
|
|
|
|
Well, In which area you are facing problem ? Loading data to the drop down ? Or getting data and binding the grid when drop down changes ? Have you made autopostback=true ? Sending sample code will be easy to understand the problem
|
|
|
|
|
I have managed to load data onto the dropdown, but binding the datagrid when something is selected from the dropdown.
Here is some code from a working vb.net page.
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
con = New OleDbConnection("Provider = Microsoft.Jet.oledb.4.0; data source = C:\TelephoneList.mdb")
con.Open()
'Dim str As String = "Select Branch,[Contact Name], [Telephone Number], [Telephone Extension], [Fax Number], [Fax Extension] from [Other Branches] Where Branch = '" & DropDownList1.SelectedValue & "'"
' Dim con As New OleDbConnection
Dim comx As New OleDbCommand
comx = New OleDbCommand("Select [Contact Name],[Telephone Number], [Telephone Extension], [Fax Number], [Fax Extension] from [Other Branches] where Branch = '" & DropDownList1.SelectedValue & "'", con)
comx.Connection = con
If con.State = ConnectionState.Open Then
con.Close()
End If
con.Open()
'Dim cm As New OleDbCommand(str, con)
GridView1.DataSource = comx.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataBind()
If con.State = ConnectionState.Open Then
con.Close()
End If
' ***********Now Im allocating data to the second datagrid
Dim comxx As New OleDbCommand
comxx = New OleDbCommand("Select [Alternative Contact], [Second Alternative], [Alt Telephone], [Alternative Ext] from [Other Branches] Where [Branch] = '" & DropDownList1.SelectedValue & "'", con)
'Dim str2 As String = "Select Branch, [Alternative Contact], [Second Alternative], [Alternative TelNumber], [Alternative TelExtension], [Cell] Where [Branch] = '" & DropDownList1.SelectedValue & "'"
comxx.Connection = con
If con.State = ConnectionState.Closed Then
con.Open()
End If
'con.Open()
'Dim command As New OleDbCommand(str2, con)
GridView2.DataSource = comxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView2.DataBind()
con.Close()
If DropDownList1.SelectedValue = "UNITRANS" Then
lblMessage.Text = "Here Are Other Users For " & DropDownList1.SelectedValue
Dim Comxxx As New OleDbCommand
Comxxx = New OleDbCommand("Select User, Telephone, Notes from [Other Users] where Branch = '" & DropDownList1.SelectedValue & "'", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
GridView3.DataSource = Comxxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView3.DataBind()
con.Close()
Else
If DropDownList1.SelectedValue = "A.HAK Industrial Services" Then
lblMessage.Text = "Here Are Other Users For " & DropDownList1.SelectedValue
Dim Comxxx As New OleDbCommand
Comxxx = New OleDbCommand("Select User, Telephone, Notes from [Other Users] where Branch = '" & DropDownList1.SelectedValue & "'", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
GridView3.DataSource = Comxxx.ExecuteReader(CommandBehavior.CloseConnection)
GridView3.DataBind()
con.Close()
End If
End If
End Sub
kagiso
|
|
|
|
|
What error you are getting here ? Are you getting values to all datareader ?
|
|
|
|
|
I don get any values out.I think the connection is a problem aswell
kagiso
|
|
|
|
|
Print your query before executing. Copy the query and execute it directly on your DB and check it is returning value..
|
|
|
|
|
Im gona have to battle to do this tonite and if I still have a problem I will get back to you.
Thanx for your assistance
kagiso
|
|
|
|
|
|
Ok, I managed to come up with this, now can anyone tell me where I went wrong coz when I run the page, i don get any values into the DropDown.
<%@ Language=VBScript %>
<%Option explicit
Dim oRs, conn, connect, strSQL
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("C:\CFusionMX\wwwroot\Working Site\Home Pagecourses.mdb") & ";Persist Security Info=False"
conn.Open connect
%>
<title>Example combo box
The following was selected : <%=Request.Form ("courses")%>
<%
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT CourseName FROM tblCourses ORDER BY CourseName"
oRs.Open strSQL, conn
Do while not oRs.EOF
if Request.Form("courses") = oRs("CourseName") then 'if this is the selected one then display as selected
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
else
Response.Write ""
Response.Write oRs("CourseName") & ""
oRs.MoveNext
end if
loop
%>
kagiso
|
|
|
|
|
Hi Guys,
I don't know if what's lacking with my source code.
I have a problem about the ID declared within the <LoggedInTemplate></LoggedInTemplate>. And in my aspx.vb code behind the ID that was supposedly be used intead was produced an error - " Webchartviewer1 not declared"
Example Code Below: Error: "Webchartviewer1 not declared"
...
<LoggedInTemplate>
<asp:Panel ID="Panel2" runat="server" BackColor="white"
Width="99%" HorizontalAlign=left>
<asp:chart:WebChartViewer ID="WebChartViewer1" runat="server"/>
</asp:Panel
</LoggedInTemplate>
...
below is aspx.vb code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
WebChartViewer1.Image = c.makeWebImage(Chart.PNG)
End Sub
hifiger2004
|
|
|
|
|
I am sending some mail by a console program using smtp server..
But in yahoo the mails r going to spam..while the same mail are going to inbox in gmail..
can anyone tell me the reason plzzzzzz.
hiiiiii
|
|
|
|
|
Are you using any authentication ?
|
|
|
|
|
ya I am using authentications...It is going to inboxbox folder of gmail but not in yahooo.????
hiiiiii
|
|
|
|
|