
ace333
Members-
Posts
22 -
Joined
-
Last visited
ace333's Achievements
Newbie (1/14)
0
Reputation
-
here is the code sample int i =0; while (myDataReader.Read()/*&&(i<120)*/) { CommentId = myDataReader["CommentId"].ToString(); Comments = myDataReader["Comments"].ToString().Replace("<","<"); Comments = Comments.Replace(">",">"); //Comments = Comments.Replace("&","&"); //Comments = Comments.Replace("�","€"); //Comments = Comments.Replace("\"","""); //Comments = Comments.Replace("'","'"); UserId = myDataReader["UserId"].ToString(); RiskId_ExternalId = myDataReader["RiskId\\ExternalId"].ToString(); i++; table=table+"<tr><td> "+myDataReader["CommentId"]+"</td><td> "+myDataReader["DacType"]+"</td><td> "+myDataReader["SheetId"]+"</td><td> "+Comments+"</td><td> "+myDataReader["TypeOfComment"]+"</td><td> "+RiskId_ExternalId+"</td><td> "+UserId+"</td><td> "+myDataReader["FullName"]+"</td><td> "+myDataReader["AmendedDateTime"]+"</td></tr>"; } table = "<html><head><title>Test</title></head><body><table border='1'>"+"<tr><td><b>CommentId</b></td><td><b> DacType</b></td><td><b>SheetId</b></td><td><b>Comments</b></td><td><b>TypeOfComment</b></td><td><b>RiskId\\ExternalId</b></td><td><b>UserId</b></td><td><b>FullName</b></td><td><b>AmendedDateTime</b></td></tr>"+table+"</table></body></html>"; TextWriter xmlContent = new StreamWriter(@"C:\Temp\xmlContent.txt"); I have written the output to a file before and after its sent through the email server and after it comes out ! are found between the <!/td> closing tags <html><head><title>Test</title></head><body><table border='1'><tr><td><b>CommentId</b></td><td><b> DacType</b></td><td><b>SheetId</b></td><td><b>Comments</b></td><td><b>TypeOfComment</b></td><td><b>RiskId\ExternalId</b></td><td><b>UserId</b></td><td><b>FullName</b></td><td><b>AmendedDateTime</b></td></tr><tr><td> 1</td><td> CAP</td><td> 107</td><td> As per L Dudley s request</td><td> RejectedComment</td><td> 78009685</td><td> lcross3</td><td> LISA CROSS</td><td> 18/08/2005 17:07:44</td></tr><tr><td> 1</td><td> CAP</td><td> 107</td><td> Payment attached to option. Option cpty changed to ISS/CRESGB2L from BOC. As payment is attached it s now showing in Payment tracker. Pls reverse. any questions plc call me. Thxs x37608</td><td> Comment</td><td> 78009685</td><td> lcross3</td><td> LISA CROSS</td><td> 18/08/2005 17:07:44</td></tr><tr><td> 1</td><td> CAP</td><td> 430</td><t! d> As per L Dudley ..... snippet of the code ..........
-
MailMessage mail = new MailMessage(); mail.To = xxx@xxx.com; mail.From = xxx@xxx.com; mail.Subject = "xxx 10/10/2005"; mail.BodyFormat = MailFormat.Html; mail.Body ="large amount of html approximately 1080 rows of a table"; SmtpMail.SmtpServer = "xxx"; SmtpMail.Send(mail); Is there a limit to the amount of data that can be send using the c# mail methods... I am trying to send 1078 rows of data through but the html I get out from the email is slightly deformed, i.e. ! are inserted between some of the </!td> tags..... If I limit it to 140 rows or less things are fine...... Is there a max number of data that can be sent at a time..... Obviously I could send more that one email, but would prefer not to do that
-
CREATE OR REPLACE PROCEDURE WES_UAT.P_INS_EMAIL ( param_sendTo IN EMAIL.SENDTO%TYPE, param_sendFrom IN EMAIL.SENDFROM%TYPE, param_subject IN EMAIL.SUBJECT%TYPE, param_format IN EMAIL.BODYFORMAT%TYPE, param_priority IN EMAIL.PRIORITY%TYPE, param_body IN EMAIL.EMAILBODY%TYPE, param_errorEmailAddress IN EMAIL.ERROREMAILADDRESS%TYPE, param_ccEmailAddress IN EMAIL.CCEMAILADDRESS%TYPE, param_systemName IN EMAIL.SYSTEMNAME%TYPE ) IS BEGIN INSERT INTO EMAIL( ID, SENDTO, SENDFROM, SUBJECT, EMAILBODY, BODYFORMAT, PRIORITY, LASTUPDATED, PROCESSEDFLAG, ERROREMAILADDRESS, CCEMAILADDRESS, SYSTEMNAME, INPUTDATE ) VALUES( SEQ_EMAIL_ID .NEXTVAL, param_sendTo, param_sendFrom, param_subject, param_body, param_format, param_priority, SYSDATE, 'N', param_errorEmailAddress, param_ccEmailAddress, param_systemName, SYSDATE ) returning id into GLOBALS.i ; END; This is an oracle stored proc How do I read the value i from the stored proc from c#, when i do the insert i want to be able to get the id associated with that insert
-
MailMessage mail = new MailMessage(); mail.To = xxx@xxx.com; mail.From = xxx@xxx.com; mail.Subject = "xxx 10/10/2005"; mail.BodyFormat = MailFormat.Html; mail.Body ="large amount of html approximately 1080 rows of a table"; SmtpMail.SmtpServer = "xxx"; SmtpMail.Send(mail); Is there a limit to the amount of data that can be send using the c# mail methods... I am trying to send 1078 rows of data through but the html I get out from the email is slightly deformed, i.e. ! are inserted between some of the </!td> tags..... If I limit it to 140 rows or less things are fine...... Is there a max number of data that can be sent at a time..... Obviously I could send more that one email, but would prefer not to do that
-
i spotted that too ya to my absolute horror i noticed that as well, i spend a day staring at this problem,,,, i nearly threw the computer across the room in frustration
-
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Oracle.DataAccess.Client.OracleException ORA-01460: unimplemented or unreasonable conversion requested at Derivatives.Ops.WebService.EmailService.SendEmail(String XML) in The problem is that i'm sending a large amount of xml to an oracle database, one of the columns is a clob, but the issue of a 32k limit is causing me problems,,, I only need to input one row in the database as that row is used somewhere else later....., all the other columns are really small... its only one column that is big .... any suggestions please thanks
-
The type or namespace name 'localhost' could not be found (are you missing a using directive or an assembly reference?) I have added a web reference from the local host but am still getting the above error localhost.EmailService test = new localhost.EmailService(); This is a project I have come back to and it worked before for the following net.xxx.app.ldnuat3.EmailService test = new net.xxx.app.ldnuat3.EmailService(); but even now this one is not working either.... this is the web reference i added here ... http://ldnuat3.app.xxx.net/wes/EmailService.asmx?WSDL why is something that worked before now not working.... i have used a lot of web services before.... what the hell is goin' on
-
CREATE OR REPLACE PACKAGE WES_UAT.MAILSERVICE AS PROCEDURE InsertEMail ( i_SendTo IN EMAIL.SendTo%TYPE, i_SendFrom IN EMAIL.SendFrom%TYPE, i_Subject IN EMAIL.Subject%TYPE, i_EMailBody IN EMAIL.EMailBody%TYPE, i_BodyFormat IN EMAIL.BodyFormat%TYPE, i_Priority IN EMAIL.Priority%TYPE, i_LastUpdated IN EMAIL.LastUpdated%TYPE DEFAULT SYSDATE, i_errorEmailAddress IN EMAIL.errorEmailAddress%TYPE, i_ccEmailAddress IN EMAIL.ccEmailAddress%TYPE, i_systemName IN EMAIL.systemName%TYPE, i_inputDate IN EMAIL.inputDate%TYPE DEFAULT SYSDATE ); PROCEDURE InsertEMail ( i_SendTo IN EMAIL.SendTo%TYPE, i_SendFrom IN EMAIL.SendFrom%TYPE, i_Subject IN EMAIL.Subject%TYPE, i_EMailBody IN EMAIL.EMailBody%TYPE, i_BodyFormat IN EMAIL.BodyFormat%TYPE, i_Priority IN EMAIL.Priority%TYPE, i_LastUpdated IN EMAIL.LastUpdated%TYPE DEFAULT SYSDATE, i_errorEmailAddress IN EMAIL.errorEmailAddress%TYPE, i_ccEmailAddress IN EMAIL.ccEmailAddress%TYPE, i_systemName IN EMAIL.systemName%TYPE, i_inputDate IN EMAIL.inputDate%TYPE DEFAULT SYSDATE ) IS BEGIN INSERT INTO EMail (SendTo, SendFrom, Subject, EMailBody, BodyFormat, Priority, LastUpdated, errorEmailAddress, ccEmailAddress, systemName, inputDate ) VALUES (i_SendTo, i_SendFrom, i_Subject, i_EMailBody, i_BodyFormat, i_Priority, i_LastUpdated, i_errorEmailAddress, i_ccEmailAddress, i_systemName, i_inputDate ); COMMIT; END INsertEMail; The procedure is part of a package... This is the c# that calls it... using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; using System.Web.Mail; using log4net; using MCE.ConfigHandler; namespace WebApplication4 { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { public OracleConnection _oraConnection = null; public void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here OracleCommand _oraCommand = new OracleCommand(); _oraCommand.CommandText = "MAILSERVICE.InsertEMail"; _oraCommand.CommandType = CommandType.StoredProcedure; _oraCommand.Connection = GetConnection(); _oraCommand.Parameters.Add("i_SendTo", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add("i_SendFrom", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add("i_Subject", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add("i_EMailBody", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add("i_BodyFormat", OracleDbType.Double, ParameterDirection.Input).Value = 1; _oraCommand.Parameters.Add("i_Priority", OracleDbType.Double, ParameterDirection.Input).Value = 1; _oraCommand.Parameters.Add(" i_errorEmailAddress", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add(" i_ccEmailAddress", OracleDbType.Varchar2, ParameterDirection.Input).Value = "noel.nicholson@csfb.com"; _oraCommand.Parameters.Add(" i_systemName", OracleDbType.Varchar2, ParameterDirection.Input).Value = "CC"; try { _oraCommand.ExecuteNonQuery(); } catch (OracleException oex) { Response.Write("Failed to execute stored procedure MAILSERVICE.InsertEMail"+"<br/>"+"<br/>"+ oex); } } public OracleConnection GetConnection() { if ( _oraConnection == null ) { _oraConnection = new OracleConnection(SecurityConfig.GetVersionSetting("WebSecurityDB") + SecurityConfig.GetVersionSetting("WebSecurityDBIdentity")); _oraConnection.Open(); } return _oraConnection; } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } This is the error I am getting... Failed to execute stored procedure MAILSERVICE.InsertEMail Oracle.DataAccess.Client.OracleException ORA-06550: line 1, column 103: PLS-00103: Encountered the symbol ":" when expecting one of the following: ( - + case mod new not null others avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String procedure, String[] args) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String[] args) at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() at WebApplication4.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication4\webform1.aspx.cs:line 50 The error revolves around the three extra columns i have added and trying to added data to them i_errorEmailAddress, i_ccEmailAddress, i_systemName, I have no idea what the problem is as all the other values work and it seems the exact same..... Can anyone spot the problem,,, I dont think the column values are wrong as two are taken from sysdate so are not there as parameters but i'm not sure :(
-
can i ask u how long it took u to do that or what way of thinking help u solve the problem,,, i feel so stupid, i've been looking at this for an hour
-
was given this problem in an interview... anyone got any ideas.... What initial values of a and c are required such that the final values of a and b are: a = 32 b = 4 � int a,b,c a = ? b = 0 c = ? for( b=0; a<12; b++ ) { a = (a+a) * c; }
-
I have an application that reads data from a database, wraps the data in html table tags and then sent as an email to myself. My problem is as follows. I have set the email format to be html so when I open the email I should see the data in a nice table format. That does not happen however. The email contains a table structure but some of the data at the start is outside the table cells, I looked at the html code and I noticed the following, that certain ! were being added between td tags like the following, <td! > The funny thing is that if I write the html that is being sent to a file like test.html and open it in a browser the table is in perfect format. So what ever way the content is sent, it becomes corrupted... I dont know why... I could paste both samples of code but I want to see if anyone has experienced a problem like this before. Any help would be great...
-
Getting the follow error from the following code...been trying to fix it for days using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text; namespace WebApplication1 { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { SqlConnection con; string sql; SqlDataAdapter adExisting; //con = new SqlConnection("Data Source=slon12d11012";User ID=nnichol1;); //con = new SqlConnection("Initial Catalog=DACari;Data Source=slon12d11012;User ID=nnichol1;Password=xxxxx"); //con = new SqlConnection("Data Source=slon12d11012;Initial Catalog=DACari;Integrated Security=SSPI;"); //con = new SqlConnection("Server=slon12d11012;Database=DACari;Trusted_Connection=yes;"); con = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DACari;Data Source=slon12d11012;Packet Size=4096;Workstation ID=WLON110355965;"); sql = "select 'RCRF' as DacType, R.Id, R.AmendmentInstructions as Comments, 'Comment' as TypeOfComment, D.ExternalID as RiskId,D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from dbo.ITRR_RCRFDetailComments R, RCRFDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.AmendmentInstructions *=D.AmendmentInstructions"; sql+="union"; sql+="select 'RCRF' as DacType, R.Id, R.ApproverComments as Comments,'RejectedComment' as TypeOfComment,D.ExternalID as RiskId, D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from ITRR_RCRFApproverComments R, RCRFDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.ApproverComments *=D.ApproverComments"; sql+="union"; sql+="select 'DAC' as DacType, R.Id, R.Comments, 'Comment' as TypeOfComment,D.RiskId, D.AmendedByUserId as UserId, D.AmendedDateTime from ITRR_DacDetailComments R, DacDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.Comments *=D.Comments"; sql+="union"; sql+="select 'DAC' as DacType, R.Id, R.RejectedComments as Comments,'RejectedComment' as TypeOfComment,D.RiskId, D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from ITRR_DacDetailRejectedComments R, DacDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.RejectedComments *=D.RejectedComments"; sql+="union"; sql+="select 'CAP' as DacType, R.CapId, R.Comments, 'Comment' as TypeOfComment, D.CurrentRiskId,D.AmendedByUserId as UserId, D.AmendedDateTime from dbo.ITRR_CAPDetailComments R, CapDetail D"; sql+="where R.CapId *= D.CapId"; sql+="and R.Comments *=D.Comments"; sql+="union"; sql+="select 'CAP' as DacType, R.CapId, R.RejectedComments as Comments,'RejectedComment' as TypeOfComment,D.CurrentRiskId, D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from ITRR_CapDetailRejectedComments R, CapDetail D"; sql+="where R.CapId *= D.CapId"; sql+="and R.RejectedComments *=D.RejectedComments"; sql+="union"; sql+="select 'MODAC' as DacType, R.Id, R.MiddleOfficeComments as Comments, 'MiddleOfficeComment' as TypeOfComment, D.RiskId,D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from ITRR_MODacDetailComments R, MODacDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.MiddleOfficeComments *=D.MiddleOfficeComments"; sql+="union"; sql+="select 'MODAC' as DacType, R.Id, R.RequestorComments as Comments,'RequestorComment' as TypeOfComment,D.RiskId, D.AmendedByUserId as UserId, D.AmendedDateTime"; sql+="from ITRR_RequestorComments R, MODacDetail D"; sql+="where R.Id *= D.Id"; sql+="and R.RequestorComments *= D.RequestorComments"; adExisting = new SqlDataAdapter(sql,con); con.Open(); DataSet ds = new DataSet(); try { adExisting.Fill(ds,"Existing"); } catch { throw; } finally { con.Close(); } /** System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection (); // TODO: Modify the connection string and include any // additional required properties for your database. conn.ConnectionString = "integrated security=SSPI;data source=slon12d11012;" + "persist security info=False;initial catalog=DACari"; try { conn.Open(); // Insert code to process data. } catch (Exception ex) { Response.Write("Failed to connect to data source"+ex.ToString()); } finally { conn.Close(); } **/ } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } Server Error in '/WebApplication1' Application. -------------------------------------------------------------------------------- Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 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.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Source Error: Line 75: Line 76: adExisting = new SqlCommand(sql,con); Line 77: con.Open(); Line 78: DataSet ds = new DataSet(); Line 79: try Source File: c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs Line: 77 Stack Trace: [sqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs:77 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +731 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
-
I have this web.config file and I have added a key value describing the connecting string to a db. I'm wondering whats the easiest way to read the value of the connection string from the web.config file, c# is the language i'm using. <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- define the custom sections used below - do not change --> <appSettings> <add key="ConnectionString" value="DATA SOURCE=DLNOTC02;User Id=snare;Password=snare"/> </appSettings> <system.web> <customErrors mode="Off" /> <compilation defaultLanguage="c#" debug="true"/> <!--<customErrors mode="Off" defaultRedirect="aspx/GlobalError.aspx" />--> <authentication mode="Windows"/> <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/> <sessionState mode="Off"/> <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB"/> <webServices> <protocols> <add name="HttpSoap"/> <add name="HttpPost"/> <add name="HttpGet"/> <add name="Documentation"/> </protocols> </webServices> </system.web> </configuration>