Search Results

Search found 19 results on 1 pages for 'pinu'.

Page 1/1 | 1 

  • OutputStream is not available when a custom TextWriter is used.

    - by Pinu
    this is my function which converts pdf to png image, it's throwing an error on this line-- stream.WriteTo(Response.OutputStream); Is there some thing wrong?? protected void CreatePngFromPdf() { try { string PDFLocation = string.Format(@"\\XXXX\{0}\{1}\{2}.pdf", Yr, Loc.Substring(0, 4), Loc.Substring(4, 4)); Utilities.WebPDF.PDF WebPDF = new DocuvaultMVC.Utilities.WebPDF.PDF(); WebPDF.Credentials = new NetworkCredential(@"xyz", "xyz"); byte[] png = WebPDF.StreamPdfPageAsPngResize(PDFLocation,PageNumber, 612, 792); MemoryStream ms = new MemoryStream(png); MemoryStream stream = new MemoryStream(); int newWidth = 612; int newHeight = 792; System.Drawing.Image newImg = System.Drawing.Image.FromStream(ms); Bitmap temp = new Bitmap(newWidth, newHeight, newImg.PixelFormat); Graphics newImage = Graphics.FromImage(temp); newImage.DrawImage(newImg, 0, 0, newWidth, newHeight); newImg.Dispose(); temp.Save(stream, ImageFormat.Png); stream.WriteTo(Response.OutputStream); temp.Dispose(); stream.Dispose(); } catch (Exception ex) { Response.Write(ex.Message.ToString()); } }

    Read the article

  • WCF- Large Data

    - by Pinu
    I have a WCF Web Service with basicHTTPBinding , the server side the transfer mode is streamedRequest as the client will be sending us large file in the form of memory stream. But on client side when i use transfer mode as streamedRequest its giving me a this errro "The remote server returned an error: (400) Bad Request" And when i look in to trace information , i see this as the error message Exception: There is a problem with the XML that was received from the network. See inner exception for more details. InnerException: The body of the message cannot be read because it is empty. I am able to send up to 5MB of data using trasfermode as buffered , but it will effect the performance of my web service in the long run , if there are many clients who are trying to access the service in buffered transfer mode. SmartConnect.Service1Client Serv = new SmartConnectClient.SmartConnect.Service1Client(); SmartConnect.OrderCertMailResponse OrderCert = new SmartConnectClient.SmartConnect.OrderCertMailResponse(); OrderCert.UserID = "abcd"; OrderCert.Password = "7a80f6623"; OrderCert.SoftwareKey = "90af1"; string applicationDirectory = @"\\inid\utty\Bran"; byte[] CertMail = File.ReadAllBytes(applicationDirectory + @"\5mb_test.zip"); MemoryStream str = new MemoryStream(CertMail); //OrderCert.Color = true; //OrderCert.Duplex = false; //OrderCert.FirstClass = true; //OrderCert.File = str; //OrderCert.ReturnAddress1 = "Test123"; //OrderCert.ReturnAddress2 = "Test123"; //OrderCert.ReturnAddress3 = "Test123"; //OrderCert.ReturnAddress4 = "Test123"; OrderCert.File = str; //string OrderNumber = ""; //string Password = OrderCert.Password; //int ReturnCode = 0; //string ReturnMessage = ""; //string SoftwareKey = OrderCert.SoftwareKey; //string UserID = OrderCert.UserID; //OrderCert.File = str; MemoryStream FileStr = str; Serv.OrderCertMail(OrderCert); // Serv.OrderCertMail(ref OrderNumber, ref Password, ref ReturnCode, ref ReturnMessage, ref SoftwareKey, ref UserID, ref FileStr ); lblON.Text = OrderCert.OrderNumber; Serv.Close(); // My Web Service - Service Contract [OperationContract] OrderCertMailResponse OrderCertMail(OrderCertMailResponse OrderCertMail); [MessageContract] public class OrderCertMailResponse { string userID = ""; string password = ""; string softwareID = ""; MemoryStream file = null; //MemoryStream str = null; [MessageHeader] //[DataMember] public string UserID { get { return userID; } set { userID = value; } } [MessageHeader] //[DataMember] public string Password { get { return password; } set { password = value; } } [MessageHeader] //[DataMember] public string SoftwareKey { get { return softwareID; } set { softwareID = value; } } [MessageBodyMember] // [DataMember] public MemoryStream File { get { return file; } set { file = value; } } [MessageHeader] //[DataMember] public string ReturnMessage; [MessageHeader] //[DataMember] public int ReturnCode; [MessageHeader] public string OrderNumber; //// Control file fields //[MessageHeader] ////[DataMember] //public string ReturnAddress1; //[MessageHeader] ////[DataMember] //public string ReturnAddress2; //[MessageHeader] ////[DataMember] //public string ReturnAddress3; //[MessageHeader] ////[DataMember] //public string ReturnAddress4; //[MessageHeader] ////[DataMember] //public bool FirstClass; //[MessageHeader] ////[DataMember] //public bool Color; //[MessageHeader] ////[DataMember] //public bool Duplex; } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] public class Service1 : IService1 { public OrderCertMailResponse OrderCertMail(OrderCertMailResponse OrderCertMail) { OrderService CertOrder = new OrderService(); ClientUserInfo Info = new ClientUserInfo(); ControlFileInfo Control = new ControlFileInfo(); //Info.Password = "f2496623"; // hard coded password for development testing purposes //Info.SoftwareKey = "6dbb71"; // hard coded software key this is a developement software key //Info.UserName = "sdfs"; // hard coded UserID - for testing Info.UserName = OrderCertMail.UserID.ToString(); Info.Password = OrderCertMail.Password.ToString(); Info.SoftwareKey = OrderCertMail.SoftwareKey.ToString(); //Control.ReturnAddress1 = OrderCertMail.ReturnAddress1; //Control.ReturnAddress2 = OrderCertMail.ReturnAddress2; //Control.ReturnAddress3 = OrderCertMail.ReturnAddress3; //Control.ReturnAddress4 = OrderCertMail.ReturnAddress4; //Control.CertMailFirstClass = OrderCertMail.FirstClass; //Control.CertMailColor = OrderCertMail.Color; //Control.CertMailDuplex = OrderCertMail.Duplex; //byte[] CertFile = new byte[0]; //byte[] CertFile = null; //string applicationDirectory = @"\\intrepid\utility\Bryan"; // byte[] CertMailFile = File.ReadAllBytes(applicationDirectory + @"\3mb_test.zip"); //MemoryStream str = new MemoryStream(CertMailFile); OrderCertMailResponseClass OrderCertResponse = CertOrder.OrderCertmail(Info,Control,OrderCertMail.File); OrderCertMail.ReturnMessage = OrderCertResponse.ReturnMessage.ToString(); OrderCertMail.ReturnCode = Convert.ToInt32(OrderCertResponse.ReturnCode.ToString()); OrderCertMail.OrderNumber = OrderCertResponse.OrderNumber; return OrderCertMail; }

    Read the article

  • WCF Service - The resource cannot be found.

    - by Pinu
    I am deployed my published the WCF web service to my server and when i am tryihg to access it its giving me following error???? The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /API/Errors/GeneralError.aspx

    Read the article

  • Connection aborted.

    - by Pinu
    I am getting this error when i am trying to upload a file of 3mb or more on my WCF client application. SocketException (0x2745): An established connection was aborted by the software in your host machine] System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73 System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +131 [IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.] System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +294 System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +26 System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +297 [WebException: The underlying connection was closed: An unexpected error occurred on a receive.] System.Net.HttpWebRequest.GetResponse() +5314029 System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +54 [CommunicationException: An error occurred while receiving the HTTP response to http://localhost:4649/Service1.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275 SmartConnectClient.SmartConnect.IService1.OrderCertMail(OrderCertMailResponse OrderCertMail1) +0 SmartConnectClient.SmartConnect.Service1Client.OrderCertMail(OrderCertMailResponse OrderCertMail1) in c:\documents and settings\pkale\my documents\visual studio 2008\projects\smartconnectclient\smartconnectclient\service references\smartconnect\reference.cs:1939 SmartConnectClient.Test_CertMail_Order.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\pkale\My Documents\Visual Studio 2008\Projects\SmartConnectClient\SmartConnectClient\Test_CertMail_Order.aspx.cs:40 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 enter code here

    Read the article

  • asp.net mvc form add comment

    - by Pinu
    I have a page where a product appears on the right side and the user can add comment so i have a user control which gets all the comments and a small text area where user can add new comment for that product. the link of the page is like http://localhost/Product/TestComment/1 Where 1 indicates the id of the product and I have been hard coding my AddNote function below and fourth argument you see has been hard coded, but i need to pass that as the id of the product. How do i do this AddNote(HttpContext.User.Identity.ToString(), txtComment, 1, DateTime.Now, true); [AcceptVerbs(HttpVerbs.Post)] public ActionResult AddComment(string txtComment) { bool rst = _NotesService.AddNote(HttpContext.User.Identity.ToString(), txtComment, 1, DateTime.Now, true); return RedirectToAction("TestComment"); }

    Read the article

  • WCF streaming files

    - by Pinu
    I need to pass a memory stream to the WCF server , how do i need to add this data type in my data contract. I will eventually need to convert this to a memory stream and pass it on to my service layer. datacontact[DataMember] Stream str = null; public Stream File { get { return str; } set { str = value; } }

    Read the article

  • SOAP-ERROR: Parsing WSDl

    - by Pinu
    In my ASP.NET website I am trying to comsume a webserice and I and getting the following error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://usaepay.com/soap/gate/3213EA2A/usaepay.wsdl' : failed to load external entity "https://usaepay.com/soap/gate/3213EA2A/usaepay.wsdl" Any idea on how to resolve it. Thanks, Pinaz.

    Read the article

  • Dynamic SQL Server stored procedure

    - by Pinu
    ALTER PROCEDURE [dbo].[GetDocumentsAdvancedSearch] @SDI CHAR(10) = NULL ,@Client CHAR(4) = NULL ,@AccountNumber VARCHAR(20) = NULL ,@Address VARCHAR(300) = NULL ,@StartDate DATETIME = NULL ,@EndDate DATETIME = NULL ,@ReferenceID CHAR(14) = NULL AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- DECLARE DECLARE @Sql NVARCHAR(4000) DECLARE @ParamList NVARCHAR(4000) SELECT @Sql = 'SELECT DISTINCT ISNULL(Documents.DocumentID, '') ,Person.Name1 ,Person.Name2 ,Person.Street1 ,Person.Street2 ,Person.CityStateZip ,ISNULL(Person.ReferenceID,'') ,ISNULL(Person.AccountNumber,'') ,ISNULL(Person.HasSetPreferences,0) ,Documents.Job ,Documents.SDI ,Documents.Invoice ,ISNULL(Documents.ShippedDate,'') ,ISNULL(Documents.DocumentPages,'') ,Documents.DocumentType ,Documents.Description FROM Person LEFT OUTER JOIN Documents ON Person.PersonID = Documents.PersonID LEFT OUTER JOIN DocumentType ON Documents.DocumentType = DocumentType.DocumentType LEFT OUTER JOIN Addressess ON Person.PersonID = Addressess.PersonID' SELECT @Sql = @Sql + ' WHERE Documents.SDI IN ( '+ QUOTENAME(@sdi) + ') OR (Person.AssociationID = ' + ''' 000000 + ''' + 'AND Person.Client = ' + QUOTENAME(@Client) IF NOT (@AccountNumber IS NULL) SELECT @Sql = @Sql + 'AND Person.AccountNumber LIKE' + QUOTENAME(@AccountNumber) IF NOT (@Address IS NULL) SELECT @Sql = @Sql + 'AND Person.Name1 LIKE' +QUOTENAME(@Address)+ 'AND Person.Name2 LIKE' +QUOTENAME(@Address)+ 'AND Person.Street1 LIKE' +QUOTENAME(@Address)+ 'AND Person.Street2 LIKE' +QUOTENAME(@Address)+ 'AND Person.CityStateZip LIKE' +QUOTENAME(@Address) IF NOT (@StartDate IS NULL) SELECT @Sql = @Sql + 'AND Documents.ShippedDate >=' +@StartDate IF NOT (@EndDate IS NULL) SELECT @Sql = @Sql + 'AND Documents.ShippedDate <=' +@EndDate IF NOT (@ReferenceID IS NULL) SELECT @Sql = @Sql + 'AND Documents.ReferenceID =' +QUOTENAME(@ReferenceID) -- Insert statements for procedure here -- PRINT @Sql SELECT @ParamList = '@Psdi CHAR(10),@PClient CHAR(4),@PAccountNumber VARCHAR(20),@PAddress VARCHAR(300),@PStartDate DATETIME ,@PEndDate DATETIME,@PReferenceID CHAR(14)' EXEC SP_EXECUTESQL @Sql,@ParamList,@Sdi,@Client,@AccountNumber,@Address,@StartDate,@EndDate,@ReferenceID --PRINT @Sql END ERROR Msg 102, Level 15, State 1, Line 23 Incorrect syntax near '000000'. Msg 105, Level 15, State 1, Line 23 Unclosed quotation mark after the character string 'AND Person.Client = [1 ]AND Person.AccountNumber LIKE[1]'.

    Read the article

  • Hosting WCF on IIS5/6

    - by Pinu
    I have developed a Web service using WCF Service Application. This service application is a part of multiple projects. we have data access , services(business logic) , testing(to test class) and WCF Service application.Where WCF Service application is just like an infterface and all the request are sent to the services project. so all the projects communicate with each other. I am new to hosting WCF application. Now to host this on IIS do i have to put the whole project in the IIS virtual directory?

    Read the article

  • A generic error occurred in GDI+.

    - by Pinu
    A generic error occurred in GDI+ [ExternalException (0x80004005): A generic error occurred in GDI+.] System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) +615257 I have a webpage in which a pdf is converted to png, and using the response.outputstream it is displayed. when i run this on my local machine is works fine. but when i run the same code on server is throws this exception. my question is , where i could look in for error. as there is no inner exception or any other information provided. only clue is that it's happening on Image.Save , but the same code works perfectly fine on my local machine , then y is it not working on production???

    Read the article

  • ASP.NET MVC Stored Procedure

    - by Pinu
    I am using a ms sql stored procedure to get a set of records , when i am adding this stored procedure to my LinqToSql class and using it my repository it shows like it is returning a int value but it should be returning a set of rows. Is there some thing wrong with my stored procedure or some thing else???

    Read the article

  • ASP.NET MVC send an email attachment which is a password encrypted PDF file

    - by Pinu
    I am working on document storage and retrieval application. In which i display the pdf document as an png image , but i have a email button on the top. On clicking that the user would be able to provide an email address to which the document needs to be sent, and I need to send this pdf as an attachment. I need to password protect the file for security reasons. I have no clue on how i can do this in asp.net mvc.

    Read the article

  • ASP.NET MVC Validations

    - by Pinu
    I need to validate the Advanced search form , but it has data to be sent to 2 different table people and documents so i am unable to use data annotations. I need to validate the Name to be characters only, account number & amount to be a number.How can i validate these fields? <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <center> <img src="../../Content/images/DocuVault_Logo.png" alt="DocuVault" /> <%= Html.ValidationSummary() %> <% using (Html.BeginForm("QuickSearch", "Search")) { %> <div id="div_QuickSearch"> <table> <tr> <td colspan="2"> <%= Html.TextBox("search", "", new { style = "width: 300px" })%> <input type="submit" value="Search" /> </td> </tr> <tr> <td colspan="2"> <%= Html.ValidationMessage("search") %> </td> </tr> <tr> <td><a href="#" id="link_advanced">Advanced Search</a></td> </tr> </table> <br /> </div> <% } %> <ul> </ul> </div> <% using (Html.BeginForm("AdvancedSearch", "Search")) { %> <div id="div_AdvancedSearch" style="display: none; width: 420px; padding: 10px;"> People <table style="border: solid 1px black; padding: 5px; width: 400px;"> <tr> <td>Name:</td> <td align="right"> <%= Html.TextBox("searchName") %> <%= Html.ValidationMessage("searchName")%> </td> </tr> <tr> <td>Address:</td> <td align="right"> <%= Html.TextBox("searchAddress") %> <%= Html.ValidationMessage("searchAddress")%> </td> </tr> <tr> <td>Account Number:</td> <td align="right"> <%= Html.TextBox("searchAccountNumber") %> <%= Html.ValidationMessage("searchAccountNumber")%> </td> </tr> </table> <br /> Documents <table style="border: solid 1px black; padding: 5px; width: 400px;"> <tr> <td>Invoice:</td> <td align="right"> <%= Html.TextBox("searchInvoice") %> <%= Html.ValidationMessage("searchInvoice")%> </td> </tr> <tr> <td>Amount:</td> <td align="right"> <%= Html.TextBox("searchAmount") %> <%= Html.ValidationMessage("searchAmount")%> </td> </tr> <tr> <td>Job:</td> <td align="right"> <%= Html.TextBox("searchJob") %> <%= Html.ValidationMessage("searchJob")%> </td> </tr> <tr> <td>SDI:</td> <td align="right"> <%= Html.TextBox("searchSDI") %> <%= Html.ValidationMessage("searchSDI")%> </td> </tr> <tr> <td>Date:</td> <td align="right"> <%= Html.TextBox("searchDateBegin", "", new { style = "width: 88px" })%> to <%= Html.TextBox("searchDateEnd", "", new { style = "width: 88px" })%> <%= Html.ValidationMessage("searchDate")%> </td> </tr> </table> <br /> <div style="width: 100%;"> <span style="float: left; margin-left: 10px;"><a href="#" id="link_quick">QuickSearch</a></span> <span style="float: right; margin-right: 10px;"><input type="submit" value="Advanced Search" /></span> </div> </div> <% } %> </center> </asp:Content>

    Read the article

  • ASP.NET Drop Down list , the button function not firing after the first click

    - by Pinu
    ASP.Net Dropdownlist , on changing the value of drop down list and clicking the button it is not sending an upadted value to the New.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test_DropDown.aspx.cs" Inherits="Test_DropDown" % <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="ddl_test" runat="server" OnSelectedIndexChanged="ddl_test_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem>First Item</asp:ListItem> <asp:ListItem>Second Item</asp:ListItem> <asp:ListItem>Third Item</asp:ListItem> </asp:DropDownList> <asp:HiddenField ID="hdf_ddl" runat="server" /> <asp:Button ID="btn_test" runat="server" Text="Button" OnClick="Button1_Click" /> </div> </form> </body> </html> using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Test_DropDown : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string passValue = ddl_test.SelectedValue.ToString(); string val = hdf_ddl.Value.ToString(); btn_test.Attributes.Add("onclick", "window.open('New.aspx?ddlValue=" + val + "', 'OpenPopWindow','left=250,top=100,width=500,height=500,toolbar=1,resizable=0,status=0,menubar=0,scrollbars=1');return false;"); //btn_test.OnClientClick = "window.open('New.aspx?ddlValue=" + val + "', 'OpenPopWindow','left=250,top=100,width=500,height=500,toolbar=1,resizable=0,status=0,menubar=0,scrollbars=1');return false;"; } protected void ddl_test_SelectedIndexChanged(object sender, EventArgs e) { hdf_ddl.Value = ddl_test.SelectedValue.ToString(); } }

    Read the article

  • ASP.NET MVC is not displaying the image

    - by Pinu
    <asp:Conte nt ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <%-- <h2>Notes</h2> <% Html.RenderPartial("~/Views/Shared/UserControl/Notes.ascx",Model.Notes); %> <br /> <h2>User Tracking Informtaion</h2> <% Html.RenderPartial("~/Views/Shared/UserControl/Tracking.ascx",Model.Log); %>--%> <div> <% for (int i = 1; i <= ViewData.Model.SelectedDocument.DocumentPages ; i++) { %> <br /> <img src="<%=DocuvaultMVC.Helpers.AppHelper.PDFUrl(ViewData.Model.SelectedDocument.DocumentID,i)%>" alt="Document" width="612" height="792" /> <%}%> <div> </div> </div> public static string PDFUrl(int id, int page) { return VirtualPathUtility.ToAbsolute("~/ViewDocument.aspx/" + id + "/" + page); }

    Read the article

  • ASP.NET MVC Using Multiple user controls on a single .aspx(view)

    - by Pinu
    I am getting this following error , when i am tring to having two user controls in one page. The model item passed into the dictionary is of type 'System.Linq.EnumerableQuery1[Data.EventLog]' but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable1[Data.Notes]'. <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Test </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Test</h2> <% Html.RenderPartial("~/Views/Shared/UserControl/Tracking.ascx"); %> <% Html.RenderPartial("~/Views/Shared/UserControl/Notes.ascx"); %> </asp:Content>

    Read the article

1