Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all 3938 articles
Browse latest View live

c# crystal report asp.net

$
0
0
hi

I use asp.net/c# for my application, so I need to preview a report with crystal report but when printing the report I have to delete some labels from the report that means the preview and the printed report are not the same

Can any one help me, please

How do I handle nulls in RadioButtonList in Repeater?

$
0
0
Greetings again.

I have this:

sp:RadioButtonList ID="rdlmhorsepType" Text='<%#Eval("horsepType").ToString()%>' runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;"  AutoPostBack="true" OnSelectedIndexChanged="horsepType_SelectedIndexChanged"><asp:ListItem Text="Electric" />
  <asp:ListItem Text="Recoil" />
</asp:RadioButtonList><br />


When a user enters his/her account number, if there is data associated with that account number, it populates a repeater form.

This part works fine.

The issue is that if no data is associated with that account number, I get the following error:

'horsepType' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

In other words, if RadioButtonList is null, it throws that error.

I have several of those on my Repeater control.

Any ideas how to resolve this?

Thanks a lot in advance

Adding API's to website

$
0
0
Hello All!

Not sure if this is the correct forum to ask this, so if not, please let me know and I will have it changed.

I have created an API for my website that Godaddy hosts on a dedicated server. I have Wordpress installed and it's on a Linux server. I created the API in Visual Studio 2015 Community and ran tests on my local PC and it works as expected. Now, I need to put it online so I can test. I am planning on having it in my WPF desktop program that when the user clicks a button it will call the API and return the result. This API will check a database to see if the license code is there and if not already used. Currently, I have static code that will return a value and not connected to the database yet.

My question: Where on my website do I put files and what files go on the website? Also, how do I find out what the actual URL will be for my button click to call the API?

Thank you in advance

Application Security Testing Tool to Check Security Vulnerability

$
0
0
Hello Everyone,

I am trying to purchase application security testing tool for my company. Any recommendation? Budget is around $1500. Few tools like

Arachni
netsparker
syhunt

thanks

c# crystal report asp.net

$
0
0
hi

I use asp.net/c# for my application, so I need to preview a report with crystal report but when printing the report I have to delete some labels from the report that means the preview and the printed report are not the same

Can any one help me, please

TypeError: $(...).autocomplete is not a function

$
0
0
<scriptsrc="../js/jquery-ui.js"></script><linkhref="../js/jquery-ui.css"rel="stylesheet"/>



<input id="txtsearch" type="text" />



$('#txtsearch').autocomplete({
          source: '~/CategoryHandler.ashx'
      });


publicvoid ProcessRequest(HttpContext context)
        {
            string name = context.Request["Name"] ?? "";
            List<string> ls = new List<string>();
 
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                SqlCommand cmd = new SqlCommand("CategoryPro", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@action", "ShowCategoryName");
                cmd.Parameters.AddWithValue("@serchname", name);
                cmd.Parameters.Add("@msg", SqlDbType.VarChar, 500);
                cmd.Parameters["@msg"].Direction = ParameterDirection.Output;
 
                SqlDataReader dr = cmd.ExecuteReader();
 
                while (dr.Read())
                {
                    ls.Add(dr["Name"].ToString());
                
                }
 
            }
            catch (Exception ex)
            {
                throw ex;
 
            }
 
            finally
            {
                con.Close();
            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            context.Response.Write(js.Serialize(ls));
        }

vb.net 2010 web form app point to correct .net framework

$
0
0
I just started to be assigned a work station that was low on memory so I accidently removed the wrong version of the .net framework. To correct the problem, I downloaded .net framework 4.0 since that is what the application uses. This web form application uses vb.net 2010 visual studio ide. 
I problem is I probably downloaded the wrong version. The application probably was using a version number 4.3 I am guessing. 
Thus I am trying to determine what I need to do to solve the problem.
Here is where the steps of where the problem lies:
'retarget the project to .net framework 4.0. After the project opens, you can retarget the
1. When I try to debug the application, I get the following error message:
”Retarget the project to .net framework 4.0.

Once I see the above message, I just click the OK button. I do not know where to point the application.
2. After that point I get lots of messages that look like the following:
AttendanceLetters\App_Code\mylistbox.vb(1): Build (web): Reference assemblies for target .NET Framework version not found; please ensure they are installed, or select a valid target version.
Thus  to solve the problem can you tell me the following:
1. Can you tell me and/or point to a url (link) that will solve the problem tell me how and/or how to point the application to the correct target link?
2. If that is not possible, do I need to download some version of the .net framework that the application is expecting to see? If so, how can I tell what version the application is looking for?
3. If the above solutions do not work. should I uninstall the visual studio 2010 that is on this workstation and reinstall a new version so that the application can find the correct version of the .net framework?
4. If you have a different solution would you tell me what I should do to solve the problem?

Need a article on repository and data access code unit testing

$
0
0
googled first but do not find any suitable one. so looking for a details article on repository and data access code in dotnet core unit testing
where we will not use any 3rd part library like mock or effort rather use anything built-in.

anything exist such like ?

can we unit test repository and data access code with intellitrace ? share idea. thanks

File Upload and Export option with VS 2015

$
0
0
Hello,

I am using Visual Studio 2015, ASP.NET framework : 4.6.1

I am trying to do file upload and export to excel. both things were working fine in VS2010 but same form, same codes are not working on VS2015.

We already configured the following :-

In webconfig :-
<appSettings><addkey="ValidationSettings:UnobtrusiveValidationMode"value="None"/></appSettings>


In Page :-
<Triggers><asp:PostBackTriggerControlID="SaveBtn"/></Triggers>


In Page Header :-
EnableEventValidation="false"


My codes are not generating any error, but even not working as expected in VS2015. If I just copy-paste the same page/code in VS2010 it will start working.

Remember : my scriptmanager is allocated in master file.

Http to Https URL rewriting

$
0
0
My requirement is straight forward. I have installed certificate , in binding added thee certificate. site is working in Https(e.g. https://abc) as expected.

But the requirement is , if any user Enters http://abc then it should redirect to https://abc

I have added the URL rewriting module. Created the Rule. The web.config file code as below



<rewrite><rules><rulename="http to https"stopProcessing="true"><matchurl="(.*)"/><conditions><addinput="{HTTPS}"pattern="^off$"/></conditions><actiontype="Redirect"url="https://{HTTP_HOST}{REQUEST_URI}"redirectType="Found"/></rule></rules></rewrite>



Help out. Its not working.

Dot Net Core 1.1 Static files(css,fonts,js) are not getting loaded when I am deploying my site in a Sub Domain

$
0
0
Hi,

I created a website in Dot Net Core 1.1.

If I am deploying my site on domain directly all static files are getting loaded and my website is running fine but as I am deploying my website in sub domain, none of the static file(css, fonts, js) is getting loaded.

Really appreciate your help in advance.

Trying to download code using GitExtensions

$
0
0
Hi,

I have been given a path of Git source Control folder which has git, hook, info etc folders inside it, I am trying to download the code hence I tried to Clone as suggested in a link, still it is putting .git folder inside my local folder which I have put as Destination and Subdirectory to Create, is there anything I am missing? Do I need to put any new SSH Key etc. I am really worried whom to ask because as there are many ways to download code using git maybe, its so much confusing. Its becoming hard and frustrating.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

regarding asp.net

$
0
0
i have created two image buttons and i have created positive and negative columns in sql. when i click the positive button,i need to increment the value in positive column in sql

regarding asp.net

$
0
0
i need a chat in asp.net application as we are using in facebook. how it will be create?

Gridview with checkboxes

$
0
0
I have a gridview where I have checkboxes on each row. You can select the checkboxes and then hit a download button. The code returns back a multipaged pdf with the files you checkboxed.

How to do you use updateprogress to show the user that I am doing a process and to keep them from hitting download more than once. I tried with a button, but I am getting
Sys.WebForms.PageRequestManagerParserErrorException: 


When I try a link button, the PDF is generated and downloaded, but no ajax updateprogress is visible.

Thanks

Unable to cast object of type 'System.DBNull' to type 'System.String'.

$
0
0
I have this RadioButtonList in Repeater control.

We are using Repeater control dynamically add new rows. I seem to handle projects where rows are dynamically added Smile | :)

In any case, when a record is added for the first time for just one row, there are no issues with this line of code:

<asp:RadioButtonList ID="rdlmhorsepType" Text='<%#string.IsNullOrEmpty((string)Eval("rdlmhorsepType")) ? "Recoil" : Eval("rdlmhorsepType") %>' runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;">


However, when one row is filled with data and another row is added, I run into the following error messages:
able to cast object of type 'System.DBNull' to type 'System.String'.

While I am at this, is there a way to populate dynamically populated dropdownlist in Repeater?

I have this:
<asp:DropDownListID="ddlPrevState"cssClass="disabledcss"runat="server"AppendDataBoundItems="True"><asp:ListItemValue=""Selected="True"></asp:ListItem></asp:DropDownList>


Here is C# code:
//I query the db in pageload() event: 
       //We query the DB only once in the Page Load
       con = new SqlConnection(ConfigurationManager.ConnectionStrings["ppmtest"].ToString());
       string sSQL = "Select sID,sName from states ORDER By sName ASC";
       // Response.Write(sSQL);//Response.End();
       SqlCommand cmd3 = new SqlCommand(sSQL, con);
       con.Open();
       cstable = new DataTable();
cstable.Load(cmd3.ExecuteReader());
  
  //Then I call it in ItemDataBound...) eventprotectedvoid repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
          var ddlPState = (DropDownList)e.Item.FindControl("ddlPrevState");
          ddlPState.DataSource = cstable;
          ddlPState.DataTextField = "sName";
          ddlPState.DataValueField = "sID";
        ddlPState.DataBind();


Any ideas how to resolve this?

Thanks as always

using asp.net c#

$
0
0
in my project image is uploaded and stored using file upholder. and i need to display image in image control (for eg: in facebook we are uploading profile picture when we logged out and login the profile picture will be displayed.)..i need tat kind ..pls give me suggestion

My service move my file Location but doesn't upload the data in sql server... here is my code

$
0
0
<pre>using System;
using System.ServiceProcess;
using System.Data.SqlClient;
using System.IO;
using System.Timers;
using System.Configuration;
using System.Data.OleDb;
using System.Data;
 

 

namespace MoveToDesiredDest
{
    publicpartialclass Service1 : ServiceBase
    {
        long delay = 5000;
        protectedstring LogPath = ConfigurationManager.AppSettings["LogPath"];
        protectedstring MoveFilePathPath = ConfigurationManager.AppSettings["MovePath"];
 
        public Service1()
        {
            InitializeComponent();
 

            Timer timer1 = new Timer();
            timer1.Elapsed += new ElapsedEventHandler(OnElapsedTime);
            timer1.Interval = delay;
            timer1.Enabled = true;
            timer1.Start();
        }
 
        protectedoverridevoid OnStart(string[] args)
        {
            WriteLog("Service started");
 

            if (!Directory.Exists(LogPath))
            {
                Directory.CreateDirectory(LogPath);
            }
 
            try
            {
 
                delay = Int32.Parse(ConfigurationManager.AppSettings["IntervalInSeconds"]) * 1000;
            }
            catch
            {
                WriteLog("IntervalInSeconds key/value incorrect.");
            }
 

            if (delay <5000)
            {
                WriteLog("Sleep time too short: Changed to default(5 secs).");
                delay = 5000;
            }
 
            //Timer timer1 = new Timer();//timer1.Elapsed += new ElapsedEventHandler(OnElapsedTime);//timer1.Interval = delay;//timer1.Enabled = true; 

        }
 
        privatevoid OnElapsedTime(object source, ElapsedEventArgs e)
        {
            write();
            Upload();
        }
      
        privatevoid write() 
        {
 
            string sourcepath = ConfigurationManager.AppSettings["sourcepath"];
            WriteLog("Set source path");
            string[] sourcefiles = Directory.GetFiles(sourcepath);
            WriteLog("Get soutce path file");
 
            foreach (string childfile in sourcefiles)
            {
                WriteLog("Start to find file from loop");
                string sourceFileName = new FileInfo(childfile).Name;
                string destinationPath = ConfigurationManager.AppSettings["destinationPath"];
 
                string destinationFileName = sourceFileName;
                string sourceFile = Path.Combine(sourcepath, sourceFileName);
                WriteLog("Get file from source to destination");
                string destinationFile = Path.Combine(destinationPath, destinationFileName);
                WriteLog("Ready to copy");
                File.Copy(sourceFile, destinationFile, true);
                WriteLog("File copied");
                File.Delete(sourceFile);
                WriteLog("File deleted");
            }
        }
        protectedvoid Upload()
        {
            string excelPath = ConfigurationManager.AppSettings["ExcelPath"];
            DirectoryInfo d = new DirectoryInfo(excelPath);
            FileInfo[] Files = d.GetFiles("*.xls");
 

 
            string str = "";
            WriteLog("ready to enter into loop");
            foreach (FileInfo file in Files)
            {
                str = file.Name;
                string sourceFilePath = ConfigurationManager.AppSettings["SourceFilePath"];
                string SourceFileName = Path.Combine(sourceFilePath, str);
 
                string destinationFilePath = ConfigurationManager.AppSettings["MovePath"];
 
                string destinationFileName = destinationFilePath + str;
 

 

                WriteLog("get file :" + str);
                String strConnection = ConfigurationManager.AppSettings["constr"];
                WriteLog("declare database connection");
                string path = excelPath + str;
 
                // string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 8.0;HDR =YES;Persist Security Info=False";string excelConnectionString = @"Microsoft.Jet.OLEDB.4.0;Data Source=" + path +";Extended Properties=Excel 8.0;HDR =YES;Persist Security Info=False";
                WriteLog("declare excel oledb connection");
                OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
 
                OleDbCommand cmd = new OleDbCommand("Select [ID],[Name] from [Sheet1$]", excelConnection);
 
                    //("Select [Department No],[Department],[Emp No],[Name],[Date],[First],[Last] from [Sheet1$]", excelConnection); 
                excelConnection.Open();
                WriteLog("oledb open");
                OleDbDataReader dReader;
 
                dReader = cmd.ExecuteReader();
 
                SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection);
 
                sqlBulk.DestinationTableName = "Test1";
                WriteLog("ready to insert into database");
                sqlBulk.WriteToServer(dReader);
                WriteLog("data inserted");
                excelConnection.Close();
                WriteLog("Process completed");
                File.Move(SourceFileName, destinationFileName);
                WriteLog("File moved to bak folder");
                excelConnection.Close();
                cmd.Dispose();
            }
        }
 
       
        protectedoverridevoid OnStop()
        {
            WriteLog("service stopped");
        }
 

        protectedvoid WriteLog(string Msg)
        {
            FileStream fs = new FileStream(LogPath + "\\" + System.DateTime.Today.ToString("yyyyMMdd") + ".log", FileMode.OpenOrCreate, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);
            sw.BaseStream.Seek(0, SeekOrigin.End);
            sw.WriteLine(System.DateTime.Now.ToString() + ": " + Msg);
            sw.Close();
            sw.Dispose();
            fs.Close();
            fs.Dispose();
        }
    }
}

Repeater2 is not getting populated with data from Repeater2. Any ideas?

$
0
0
Hi Richard, sorry to call you out but can you please help me on this issue?

I have been stomped by this now for almost 2 days.

I dynamically creating rows for both Repeater1 and Repeater2.

There is a form field called MarineRegNo on Repeater1.

Once a user enters value for this field and clicks the Next button, that value is transferred a form field called aRegNo in Repeater2.

The issue we are having is that if it is just one row, this value is not getting populated in Repeater2.

If there are two rows for instance, the first row in Repeater2 is not getting populated with value for aRegNo. However, the second row is getting populated with values for aRegNo for Repeater2.

I believe the issue lines with SetInitialRow and SetInitialRow2 functions as I think the values are getting overwritten.

Do you have any ideas how I can resolve this?

There is a ton more codes but I think the two functions below are the relevant codes that are causing the problems.

Thanks as usual for your assistance.

<pre>    private void SetInitialRow()
    {
        myMultiView.ActiveViewIndex = 0;
        DataTable dt;
        if (ViewState["CurrTable"] == null)
        {
            dt = new DataTable();
            DataRow dr = null;
            dt.Columns.Add(new DataColumn("ID", typeof(string)));
            dt.Columns.Add(new DataColumn("MarineRegNo", typeof(string)));
            dt.Columns.Add(new DataColumn("TaxPyrRetdVal", typeof(string)));
            dt.Columns.Add(new DataColumn("VesselRegNo", typeof(string)));
            dt.Columns.Add(new DataColumn("VesselTaxPyrRetdVal", typeof(string)));
 
            dr = dt.NewRow();
            dr["ID"] = 1;
            dr["MarineRegNo"] = string.Empty;
            dr["TaxPyrRetdVal"] = string.Empty;
            dr["VesselRegNo"] = string.Empty;
            dr["VesselTaxPyrRetdVal"] = string.Empty;
            dt.Rows.Add(dr);
        }
        else
        {
            dt = (DataTable)ViewState["CurrTable"];
        }
        ViewState["CurrTable"] = dt;
        if (dt.Rows.Count > 0)
        {
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
        }
    }
 
    private void SetInitialRow2(string registerNumber, string bregisterNumber)
    {
        DataTable dts;
        if (ViewState["CurrentTable"] == null)
        {
            dts = new DataTable();
            DataRow dr = null;
        //Create DataTable columns
        dts.Columns.Add(new DataColumn("RowNumber", typeof(string)));
        dts.Columns.Add(new DataColumn("boatcnty", typeof(string)));
        dts.Columns.Add(new DataColumn("aRegNo", typeof(string)));
        dts.Columns.Add(new DataColumn("aMake", typeof(string)));
        dts.Columns.Add(new DataColumn("mMake", typeof(string)));
        dts.Columns.Add(new DataColumn("ModelNoA", typeof(string)));
        dts.Columns.Add(new DataColumn("ModelNoM", typeof(string)));
        dts.Columns.Add(new DataColumn("boatYrBuilt", typeof(string)));
        dts.Columns.Add(new DataColumn("motorYrBuilt", typeof(string)));
        dts.Columns.Add(new DataColumn("blength", typeof(string)));
        dts.Columns.Add(new DataColumn("hullmaterial", typeof(string)));
        dts.Columns.Add(new DataColumn("mhorsepower", typeof(string)));
        dts.Columns.Add(new DataColumn("rdlmhorsepType", typeof(string)));
        dts.Columns.Add(new DataColumn("datePurchased", typeof(string)));
        dts.Columns.Add(new DataColumn("mdatePurchased", typeof(string)));
        dts.Columns.Add(new DataColumn("PurchaseType", typeof(string)));
        dts.Columns.Add(new DataColumn("rblmPurchasedType", typeof(string)));
        dts.Columns.Add(new DataColumn("PrevOnwerName", typeof(string)));
        dts.Columns.Add(new DataColumn("prevAddr", typeof(string)));
        dts.Columns.Add(new DataColumn("prevCity", typeof(string)));
        dts.Columns.Add(new DataColumn("PrevState", typeof(string)));
        dts.Columns.Add(new DataColumn("prevzip", typeof(string)));
        dts.Columns.Add(new DataColumn("mPrevOnwerName", typeof(string)));
        dts.Columns.Add(new DataColumn("mprevAddr", typeof(string)));
        dts.Columns.Add(new DataColumn("mprevCity", typeof(string)));
        dts.Columns.Add(new DataColumn("mPrevState", typeof(string)));
        dts.Columns.Add(new DataColumn("mprevzip", typeof(string)));
        dts.Columns.Add(new DataColumn("buyername", typeof(string)));
        dts.Columns.Add(new DataColumn("buyeraddress", typeof(string)));
        dts.Columns.Add(new DataColumn("buyercity", typeof(string)));
        dts.Columns.Add(new DataColumn("buyerstate", typeof(string)));
        dts.Columns.Add(new DataColumn("buyerzip", typeof(string)));
        dts.Columns.Add(new DataColumn("datesold", typeof(string)));
        dts.Columns.Add(new DataColumn("salePrice", typeof(string)));
        dts.Columns.Add(new DataColumn("Description", typeof(string)));
        dts.Columns.Add(new DataColumn("mbuyername", typeof(string)));
        dts.Columns.Add(new DataColumn("mbuyeraddress", typeof(string)));
        dts.Columns.Add(new DataColumn("mbuyercity", typeof(string)));
        dts.Columns.Add(new DataColumn("mbuyerstate", typeof(string)));
        dts.Columns.Add(new DataColumn("mbuyerzip", typeof(string)));
        dts.Columns.Add(new DataColumn("mdatesold", typeof(string)));
        dts.Columns.Add(new DataColumn("msalePrice", typeof(string)));
        dts.Columns.Add(new DataColumn("mDescription", typeof(string)));
        dts.Columns.Add(new DataColumn("boatCost", typeof(string)));
        dts.Columns.Add(new DataColumn("motorCost", typeof(string)));
        dts.Columns.Add(new DataColumn("rblIssues", typeof(string)));
        dts.Columns.Add(new DataColumn("functionalIsses", typeof(string)));
        dts.Columns.Add(new DataColumn("mrblIssues", typeof(string)));
        dts.Columns.Add(new DataColumn("mfunctionalIsses", typeof(string)));
        dts.Columns.Add(new DataColumn("vesseltypeUse", typeof(string)));
        dts.Columns.Add(new DataColumn("vesselname", typeof(string)));
        dts.Columns.Add(new DataColumn("vessellength", typeof(string)));
        dts.Columns.Add(new DataColumn("vesselYrBult", typeof(string)));
        dts.Columns.Add(new DataColumn("VesselHullMateria", typeof(string)));
        dts.Columns.Add(new DataColumn("vesselhorsepEngine", typeof(string)));
        dts.Columns.Add(new DataColumn("coastGuardNumber", typeof(string)));
        dts.Columns.Add(new DataColumn("VesselYrPurchased", typeof(string)));
        dts.Columns.Add(new DataColumn("PurchasedNew", typeof(string)));
        dts.Columns.Add(new DataColumn("VesselPurchaseAmt", typeof(string)));
        dts.Columns.Add(new DataColumn("homePort", typeof(string)));
        dts.Columns.Add(new DataColumn("whereDocked", typeof(string)));
        dts.Columns.Add(new DataColumn("bmequipAccessoryList", typeof(string)));
        //Create Row for each columns
        dr = dts.NewRow();
        dr["RowNumber"] = 1;
        dr["boatcnty"] = string.Empty;
        dr["aRegNo"] = registerNumber;
        dr["aMake"] = string.Empty;
        dr["mMake"] = string.Empty;
        dr["ModelNoA"] = string.Empty;
        dr["ModelNoM"] = string.Empty;
        dr["boatYrBuilt"] = string.Empty;
        dr["motorYrBuilt"] = string.Empty;
        dr["blength"] = string.Empty;
        dr["hullmaterial"] = string.Empty;
        dr["mhorsepower"] = string.Empty;
        dr["rdlmhorsepType"] = string.Empty;
        dr["datePurchased"] = string.Empty;
        dr["mdatePurchased"] = string.Empty;
        dr["PurchaseType"] = string.Empty;
        dr["rblmPurchasedType"] = string.Empty;
        dr["PrevOnwerName"] = string.Empty;
        dr["prevAddr"] = string.Empty;
        dr["prevCity"] = string.Empty;
        dr["PrevState"] = string.Empty;
        dr["prevzip"] = string.Empty;
        dr["mPrevOnwerName"] = string.Empty;
        dr["mprevAddr"] = string.Empty;
        dr["mprevCity"] = string.Empty;
        dr["mPrevState"] = string.Empty;
        dr["mprevzip"] = string.Empty;
        dr["buyername"] = string.Empty;
        dr["buyeraddress"] = string.Empty;
        dr["buyercity"] = string.Empty;
        dr["buyerstate"] = string.Empty;
        dr["buyerzip"] = string.Empty;
        dr["datesold"] = string.Empty;
        dr["salePrice"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["mbuyername"] = string.Empty;
        dr["mbuyeraddress"] = string.Empty;
        dr["mbuyercity"] = string.Empty;
        dr["mbuyerstate"] = string.Empty;
        dr["mbuyerzip"] = string.Empty;
        dr["mdatesold"] = string.Empty;
        dr["msalePrice"] = string.Empty;
        dr["mDescription"] = string.Empty;
        dr["boatCost"] = string.Empty;
        dr["motorCost"] = string.Empty;
        dr["rblIssues"] = string.Empty;
        dr["functionalIsses"] = string.Empty;
        dr["mrblIssues"] = string.Empty;
        dr["mfunctionalIsses"] = string.Empty;
        dr["vesseltypeUse"] = string.Empty;
        dr["vesselname"] = string.Empty;
        dr["vessellength"] = string.Empty;
        dr["vesselYrBult"] = string.Empty;
        dr["VesselHullMateria"] = string.Empty;
        dr["vesselhorsepEngine"] = string.Empty;
        dr["coastGuardNumber"] = bregisterNumber;
        dr["VesselYrPurchased"] = string.Empty;
        dr["PurchasedNew"] = string.Empty;
        dr["VesselPurchaseAmt"] = string.Empty;
        dr["homePort"] = string.Empty;
        dr["whereDocked"] = string.Empty;
        dr["bmequipAccessoryList"] = string.Empty;
        dts.Rows.Add(dr);
        }
        else
        {
            dts = (DataTable)ViewState["CurrentTable"];
        }
        //Store the DataTable in ViewState for future reference
        ViewState["CurrentTable"] = dts;
        if (dts.Rows.Count > 0)
        {
        Repeater2.DataSource = dts;
        Repeater2.DataBind();
        }
    }

System.ServiceModel.FaultException`1 occurred

$
0
0
I wrote a UPS Rate Quote Service in c# using the supplied WSDL file.
So now I'm testing it, at first the error in transmitting the SOAP file was "An exception has been raised as a result of client data." and the catch would catch it using Exception. Same thing with FaultException.

I read the stack trace, it refers to the Soap call to ProcessRate(Security, Request) in reference.cs and went to line 6492 and 6499.
I wrote another class as the bare minimum and transmitted again and got the same result.

I really don't know how to proceed here.

Soap Call
try
{
   using (var client = new ups_rateService.RatePortTypeClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(endpointUrl)))
  {   
      pResult = client.ProcessRate(Security, pRequest);
  }
}
catch (Exception e)
{
      Console.WriteLine(e.Message.ToString());
}
Resources.cs
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Indigo.Services.ups_rateService.RateResponse1 Indigo.Services.ups_rateService.RatePortType.ProcessRate(Indigo.Services.ups_rateService.RateRequest1 request) {
            returnbase.Channel.ProcessRate(request); // line 6492
        }
 
        public Indigo.Services.ups_rateService.RateResponse ProcessRate(Indigo.Services.ups_rateService.UPSSecurity UPSSecurity, Indigo.Services.ups_rateService.RateRequest RateRequest) {
            Indigo.Services.ups_rateService.RateRequest1 inValue = new Indigo.Services.ups_rateService.RateRequest1();
            inValue.UPSSecurity = UPSSecurity;
            inValue.RateRequest = RateRequest;
 
            // line 6499
            Indigo.Services.ups_rateService.RateResponse1 retVal = ((Indigo.Services.ups_rateService.RatePortType)(this)).ProcessRate(inValue);
            return retVal.RateResponse;
        }

Stack Trace
System.ServiceModel.FaultException`1 occurred
HResult=0x80131501
Message=An exception has been raised as a result of client data.
Source=mscorlib
StackTrace:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Indigo.Services.ups_rateService.RatePortType.ProcessRate(RateRequest1 request)
at Indigo.Services.ups_rateService.RatePortTypeClient.Indigo.Services.ups_rateService.RatePortType.ProcessRate(RateRequest1 request) in J:\Indigo.Services\Service References\ups_rateService\Reference.cs:line 6492
at Indigo.Services.ups_rateService.RatePortTypeClient.ProcessRate(UPSSecurity UPSSecurity, RateRequest RateRequest) in J:\Indigo.Services\Service References\ups_rateService\Reference.cs:line 6499
at Indigo.Services.UPS_Soap_Rate.transmit_request(model_shipRates_rate_request p, RateRequest pRequest) in J:\Indigo.Services\Business Logic\Ship Processors\UPS\UPS_Soap_Rate.cs:line 203
 
If it ain't broke don't fix it
Viewing all 3938 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>