|
|
Is your question about gridview formatting?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
My client will be sending the request as described below in SOAP format.
<RequestTimestamp>2014-08-22T11:28:00Z</RequestTimestamp>
<SystemID>TestProcessor</SystemID>
<Version>1<Version>
<QWID>201507080000001</QWID>
<QWID>201507080000010</QWID>
<QWID>201507080000001</QWID>
<QWID>201507080000010</QWID>
<QWID>201507080000001</QWID>
<QWID>201507080000010</QWID>
<CHL>201507080000010</CHL>
In every request, QWID should come as batch and I proposed below entity design to adopt above data.
public class APIRequest
{
[DataMember]
public DateTime RequestTimestamp;
[DataMember]
public string SystemID;
[DataMember]
public int Version;
[DataMember]
public string[] QWID;
[DataMember]
public string CHL;
}
With above entity design, SOAP request generated as
<request xmlns:a="http://schemas.datacontract.org/2004/07/QWID.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:RequestTimestamp>0001-01-01T00:00:00</a:RequestTimestamp>
<a:SystemID>WireSystem_001</a:SystemID>
<a:Version>0</a:Version>
<a:QWID xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<b:string>20141023010232_ORG99000002_CTR.fedwire</b:string>
<b:string>20141023010842_ORG99000001_CTR.fedwire</b:string>
</a:QWID>
</request>
My client expecting the SOAP request in the form of <QWID>201507080000001</QWID> instead of coming under <QWID><b:string>20141023010232_ORG99000002_CTR.fedwire</b:string> </QWID> as string tag.
How do i do the entity design (without grouping of QWID) to achieve client expectation as described above? Please help me on this?
modified 14-Jul-15 21:54pm.
|
|
|
|
|
Hi All.
In my e-commerce web application, im using one of finance application to transfer invoices, therefore i have to use there o Auth api service and Authenticate from them. Can you please share some sample for create custom oAuth service which will open as Pop-up and asking the credentials...etc. Same time i need retrieve the token from them.
Thanks
|
|
|
|
|
Do not cross-post questions. You have already asked this at Custome oAuth Service[^] so stick to one question and be ready to provide more input if needed.
|
|
|
|
|
Hi All,
I used the rdlc report in my Web form application c#, and in the development environment every thing work fine, but when publish the Application Over the IIS the report viewer didn't show any thing and an error occurred.
"System.NotSupportedException: The given path's format is not supported."
Please let me know how to solve this issue.
Thanks All
|
|
|
|
|
Without seeing the actual code etc it's quite hard to say why the problem occurs but the problem is that the path given is not valid.
So (re)check:
- That the path is a real path.
- If drive is defined in the path, check that semicolon ( : ) is the second character.
- No extra characters anywhere in the path definition.
I believe it would be a good idea to write the path into a log file so you can see what path is actually used on the IIS server.
|
|
|
|
|
Hi,
I recheck and print the report path in the log file and it is a correct path but still the report not shown in the report viewer and the same error occurred.
|
|
|
|
|
What does the path look like that you use?
|
|
|
|
|
Hi,
This is the path and it is a correct path when use it the report file open.
C:\inetpub\wwwroot\HRNEW\Reports\PermitsRpt.rdlc
HRNEW: is my application.
Reports: is reports folder in my application
|
|
|
|
|
Looks perfectly legit...
Did I understand correctly that the exact same path from exact same variable is working in another statement and is not working in another. Could the value be changed in between?
Also if you concatenate the path from parts, I suggest using Path.Combine[^].
If these do not help, please post all relevant code parts.
|
|
|
|
|
Hi,
I use the path.combine and still the same thing,
The report viewer not show the data and the log file contains the same error.
"System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Web.InternalSecurityPermissions.PathDiscovery(String path)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath)
at System.Web.HttpServerUtility.MapPath(String path)"
|
|
|
|
|
You're passing a physical file-system path to the MapPath method, which only accepts virtual paths.
Try using ~/Reports/PermitsRpt.rdlc as the path instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
While Hosting RDLC report on IIS Then it requires following dll files on IIS.
1) Microsoft.ReportViewer.Common
2) Microsoft.ReportViewer.ProcessingObjectModel
3) Microsoft.ReportViewer.WebForms
Set Web.config file..
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
</compilation>
</system.web>
|
|
|
|
|
Hello,
i am a beginner with basic knowledge of c++,C# and ASP.net, Java script. I also learned to create dummy project by ASP.net but not able to create live project but that has three year gap due to illness. . I want to start it again please let me know what would be the right direction for that
|
|
|
|
|
|
<condition binding="{Binding Path=Value.DeviceSensorAssociationModelViewCollection[0].WiredDevicePlaceholder.ParentModelView.HasAssociatedSensor}"
="" value="true"> what is meaning of it..please elobrate
|
|
|
|
|
What's actual question, in what context? Do you mean to ask how to bind data/contents?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
|
I am trying to send email using gmail smtp. In localhost it's working perfectly but when I'm uploading to the server it's throwing the following exception.
Quote: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at contact.btnSubmit_ServerClick(Object sender, EventArgs e) in c:\inetpub\wwwroot\contact.aspx.cs:line 156System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.Send(MailMessage message)System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.200.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
my code is
var fromAddress = new MailAddress("abcd@gmail.com", "from");
var toAddress = new MailAddress("cdef@yahoo.com", "To Name");
const string fromPassword = "password";
const string subject = "Hello";
const string body = "Hi there";
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
};
using (var messag = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body
})
try
{
smtp.Send(messag);
}
catch (Exception ex)
{
Exception ex2 = ex;
string errorMessage = string.Empty;
while (ex2 != null)
{
errorMessage += ex2.ToString();
ex2 = ex2.InnerException;
}
}
Please help.
modified 9-Jul-15 8:11am.
|
|
|
|
|
Have you read THIS[^] article?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
I was just wondering if adding a single quote mark to an embedded query string parameter in a hard coded SQL query could cause a SQL injection error? As you can see after the @docNum parameter I am using both the percent and single quote characters. Somewhere in my code something is causing the error. Now if I were to only use a single percent character % instead of both the % and the single quote character %' unlike in the StringBuilder appended line below would this the stop the error from occurring?
sb.Append("AND docNumTCN LIKE @docNum%' "<pre>
modified 8-Jul-15 17:20pm.
|
|
|
|
|
I don't know if I understand your "SQL Injection error". SQL Injection is not an "error" it is an attack.
Anyways, SQL Injection only happens when you concatenate user provided strings or replace your actual SQL string with user provided data. Is @docNum is a real parameter (filled used a parameter, not a string replace) then your string is not going to suffer SQL Injection.
Anyways, I think the @docNum% will not work. You are supposed to use @docNum only... the % must be part of the docNum content (I don't know if databases support comining a parameter with %... never tried, it simply looks wrong). But even if the % works, I am pretty sure the ' will become a parser error.
|
|
|
|
|
You can't use a parameter like that. Either add the % to the parameter value:
sb.Append("AND docNumTCN Like @docNum ");
cmd.Parameters.AddWithValue("@docNum", docNum + "%");
or append the % as a literal string in SQL:
sb.Append("AND docNumTCN Like @docNum + '%' ");
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I created a few roles for users and I'm trying to assing a role to a specific user but I get this error:
<pre lang="c#">An exception of type 'System.NullReferenceException' occurred in Microsoft.Owin.Host.SystemWeb.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
If there is a handler for this exception, the program may be safely continued.
and
Line 47: get
Line 48: {
Line 49: return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
Line 50: }
Line 51: private set
In AccountController I don't have anything for this option. This is the function from Controller that should assing the role:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult RoleAddToUser(string UserName, string RoleName)
{
ApplicationUser user = context.Users.Where(u => u.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
var account = new AccountController();
account.UserManager.AddToRole(user.Id, "RoleName");
<pre>
ViewBag.ResultMessage = "Role created successfully !";
var list = context.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem { Value = rr.Name.ToString(), Text = rr.Name }).ToList();
ViewBag.Roles = list;
return View("ManageUserRoles");
}</pre>
Where is the mistake?
|
|
|
|
|