|
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?
|
|
|
|
|
Did you DEBUG your code? Where did the exception occur?
_userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
What is _userManager AND HttpContext.GetOwinContext().GetUserManager<applicationusermanager>() are NULL. What would then be the behaviour?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi,
can anybody help me to coonect to vpn using .bat file ?
i want to create a .bat file to connect to vpn so that i don't have to pass username and password details to connect to vpn .
i just connected to vpn by double clicking on .bat file.
|
|
|
|
|
This is not the right place to ask that question. This is the ASP.Net forum.
It will depend on what vpn software you are using. Some may not support what you want.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a Webforms WebApp, and I'm toying with the idea of switching to Entity Framework 6.0 on it.
My idea is to create a dataAccessLayer.dll.
So I decided to spend a day testing the idea, and I'm not sure if I should create a edmx file, or if I'll suppose to hard code using models in a class.
I did import or create a edmx file, but creating the relationships is vague to me, and can't seem to find a decent lesson on it.
I created a couple class files, but the examples I used seem vague as well. This is what the Contoso University Example used in VB.
Example of one of my class files
Imports System.Data.Entity
Imports System.Collections.Generic
Imports System.ComponentModel.DataAnnotations
Imports System.Data.Entity.Infrastructure
Namespace Models
Public Class Customer_Accounts
Public Property ID As Integer
Public Property Advanced As Boolean
Public Property AccountName As String
Public Property FirstName As String
Public Property LastName As String
Public Property EmailAddress As String
Public Property Password As Byte
Public Property PasswordSalt As Byte
Public Property PhraseHint As String
Public Property PhraseAnwser As String
Public Property DateOpened As DateTime
Public Property Lockout As Boolean
Public Property LastLogin As DateTime
Public Property IPAddress As String
End Class
End Namespace
I did a job a couple of months ago in c#, and this guy made his class like this, I can see how this can create the tables in the database.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using DataAccessLibrary.Models;
namespace DataAccessLayer.Models
{
public class Customer : EntityBase, IValidatableObject
{
#region Public Constructors
public Customer()
{
SalesOrders = new ObservableListSource<SalesOrderHeader>();
Addresses = new ObservableListSource<CustomerAddress>();
}
#endregion Public Constructors
#region Public Properties
[Description("List of addresses for this customer")]
public virtual ObservableListSource<CustomerAddress> Addresses { get; set; }
[Description("This customer's business name.")]
[DisplayName("Business Name")]
[StringLength(45)]
[Index(IsUnique = true)]
public string BusinessName { get; set; }
I can't see how a table can be created from this class.
Im just looking for some suggestions on how you would do this, or if it even can be done.
|
|
|
|
|
I am novice in programming and I have been working out developing Learning Management System to facilate the teaching and learning in the community based schools and colleges. I am also trying to build Single Page Application in MVC4 but I have some queries regarding whether it will be handy to use Ajax or how we develope SPA in MVC4 framework without using Ajax?
I will be pleased having your additional ideas.
Thank you in advance
Regards
Ishwor Khanal
|
|
|
|
|
|
So this is related to my VB post on FirstData V19 SOAP, but is the final piece of the puzzle.
I finally figured out why I can't match the Transmission of the SOAP Body to the copy of the the SOAP Body.
My Soap Body Contains and empty element for Address 2. And the transmitted SOAP Body just closes the empty element. So the 2 don't match, and I get the wrong content digest.
If there amy way using XMLWriter that I can close empty elements? Or will I have to do further manipulation?
SOAP Examples
'Copy of SOAP Body
<Address1 xsi:type="xsd:string">1234 Main Street</Address1><Address2 xsi:type="xsd:string"></Address2>
'Actual SOAP Body Transmitted.
<Address1 xsi:type="xsd:string">1234 Main Street</Address1><Address2 xsi:type="xsd:string"/>
My Code
Dim buffer As MessageBuffer = request.CreateBufferedCopy(Int32.MaxValue)
request = buffer.CreateMessage
Dim msg As Message = buffer.CreateMessage
Dim encoder As UTF8Encoding = New UTF8Encoding
Dim txn As MemoryStream = New MemoryStream
Dim xmlSettings As New XmlWriterSettings
With xmlSettings
.OmitXmlDeclaration = True
End With
Using xmlWriter As XmlWriter = xmlWriter.Create(txn, xmlSettings)
Using writer As XmlDictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(xmlWriter)
msg.WriteStartEnvelope(writer)
msg.WriteStartBody(writer)
msg.WriteBodyContents(writer)
xmlWriter.WriteEndElement()
xmlWriter.WriteEndElement()
writer.Flush()
End Using
End Using
'Convert the MemoryStream to a Byte Array
Dim txn_string As String = encoder.GetString(txn.ToArray()).Replace(" />", "/>")
Dim xml_bytes() As Byte = encoder.GetBytes(txn_string)
|
|
|
|
|
Please help me I am using this script..
FIND THE FULL CODE HERE
http://pastebin.com/qY1cN1ry[^]
public void sendemail(int MemberId, DataTable Member, int rowNo)
{
MailMessage msgMail = new MailMessage();
msgMail.To = Member.Rows[rowNo]["EmailID"].ToString();
msgMail.From = "admin@auditionbollywood.com";
msgMail.Subject = "Auditions BollyWood Account Expire";
msgMail.BodyFormat = MailFormat.Text;
StringBuilder sb = new StringBuilder();
sb.AppendFormat("Hi !\n\n");
sb.AppendFormat("Your Audition Bollywood Account has been expired.Please pay the payment for activation.\n");
sb.AppendFormat("Click the below link to pay to activate your account\n");
string link = string.Format("http://www.auditionbollywood.com/paymentrenewal.aspx?MemberId={0}", MemberId.ToString());
sb.Append(link);
sb.AppendFormat("\n\nThank You");
msgMail.Body = sb.ToString();
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "mail.auditionbollywood.com");
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587);
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2);
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "admin@auditionbollywood.com");
msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "**********");
SmtpMail.SmtpServer = "mail.auditionbollywood.com";
SmtpMail.Send(msgMail);
}
|
|
|
|
|