|
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);
}
|
|
|
|
|
Check your authentication and network credentials to this email server (and account).
|
|
|
|
|
How to display day name on selected date in textbox.
PS. Using VS 2013, ASP.NET
|
|
|
|
|
Try
CultureInfo local = CultureInfo.CurrentCulture;
int day = (int)DateTime.Now.DayOfWeek;
txtDay.Text = local.DateTimeFormat.DayNames[day];
Display this day in the textbox.
|
|
|
|
|
I have one textbox with datepicker(AJAX) and I want to display day name as per selected date on another textbox .
|
|
|
|
|
Hi All,
I've been using DotNetOpenAuth in my MVC / WebAPI solutions for a while now and I've attempted to upgrade to MVC5 and WebAPI2 twice now and due to so many issues with DotNetOpenAuth I've failed both times to get it all working.
Since this project seems to be either dead or moving at a horrifically slow pace what are the alternatives for both a client and server solution?
I'm stumped at how some people seem to have gotten it to work as I'm failing miserably.
Thanks,
James
|
|
|
|
|
Hi everyone.. I had tried to post on linkedin using many apis in asp.net but not succeeded. Please any one show me how to do that?
|
|
|
|
|
|
I am asked to find out if it is possible to switch the gateway inside my app that has the IE web control. I have a program that allows terminal users log into data service sites and get data back. The problem is that I need to change the gateway so that the data service comes from 2 gateway different gateways.
Thanks,
|
|
|
|
|
I am exporting a data table to Excel, but my row height get wildly large, how can this be changed to actually set the row height?
public void ExportToExcel(DataTable dataTable)
{
string filename = "Report.xls";
StringWriter tw = new System.IO.StringWriter();
HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
DataGrid dgGrid = new DataGrid();
dgGrid.DataSource = dataTable;
dgGrid.DataBind();
dgGrid.RenderControl(hw);
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}
|
|
|
|
|
use EPPLUS. You can easily set a DataTable object to Excel (2007 and newer) and Fully layout your sheet.
Heights, fonts, colors and much much more.
See here[^].
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Different between String And StringBuilder
|
|
|
|
|
|
In String Builder When we change the variable value then it does not create new object,It modify again and again same object,but in string if we modify the string variable value then it again and again create a object.So if we have to update string again and again then recommended to use String Builder always.
|
|
|
|
|
|
Hi I am planning to develop a software app using ASP.NET and SqlServer DB. I just wanna know what all the software I need to procure for complete implementation
and from where
|
|
|
|
|
You Need a Microsoft Visual Studio and Microsoft Sql Server only dear.
|
|
|
|
|
You can get these free - Visual Studio Express and SQL Server Express (Google them)
|
|
|
|