Binary Palindromic Numbers
Tree Traversal in C#
Run .NET 4.7 on a Mono Image
Hi,
what do I have to consider, if I want to execute a .NET 4.7 application on a Mono system?
Best regards,
Christian
How do I pass Datatable to another form?
Newbie (3rd week of learning c#)
I have a form with a datagridview, and the user selects a single record.
In the ok_onclick function(method?) of the first form, I execute a query based on selection and place the entire row into a datatable. I can see the data so I know the query was successful.
Now I need to open a second form and populate the textboxes on it with the contents of the datatable created by the ok_onclick function on the previous form.
It appears I must add something in the second form's code in order to assign the datatable's values to each textbox.. but what and where?
Bitwise advice requested
/*
* Environment: Visual Studio 2010 (Dotnet 4.0) (Legacy Project)
This code works. Is there a better way to extract the two middle bits?
Here are the four possible values for the two middle bits. */
Byte b00 = Convert.ToByte("11100111", 2);
Byte b01 = Convert.ToByte("11101111", 2);
Byte b10 = Convert.ToByte("11110111", 2);
Byte b11 = Convert.ToByte("11111111", 2);
/*
Shift first three bits off to the left.
Then shift everything back 6 bits.
There must be a cleaner better way?*/
Byte zero = (Byte)((Byte)(b00 << 3) >> 6);
Byte one = (Byte)((Byte)(b01 << 3) >> 6);
Byte two = (Byte)((Byte)(b10 << 3) >> 6);
Byte three = (Byte)((Byte)(b11 << 3) >> 6);
Console.WriteLine(zero); // Prints 0
Console.WriteLine(one); // Prints 1
Console.WriteLine(two); // Prints 2
Console.WriteLine(three);// Prints 3
/*
* Thanks for your time.
* *
need some help with Lists
I am running into trouble with this program. For some reason I am getting an Index out of bounds error
I am not sure why. It was written in C#. Suggestions would be nice.
NOTE. the file is a .CSV. and var L is one outlined box.
lines is defined as follows...
string line = string.Empty; List<string[]> lines = new List<string[]>(); if(args.Length < 1) while((line = Console.ReadLine()) != null) lines.Add(line.Split(',')); else { foreach(var l in File.ReadAllLines(args[0])) { lines.Add(l.Split(',')); } }
The line I am having trouble with is
int.Parse(lines[2][2].Replace("bpm", string.Empty))
public static void Main(string[] args) { string line = string.Empty; List<string[]> lines = new List<string[]>(); if(args.Length < 1) while((line = Console.ReadLine()) != null) lines.Add(line.Split(',')); else { foreach(var l in File.ReadAllLines(args[0])) { lines.Add(l.Split(',')); } } //Console.WriteLine(args[0]);Console.ReadLine();return; quarterNoteBPM = int.Parse(lines[2][2].Replace("bpm", string.Empty)); int firstNoteLineID = getFirstNoteIndex(lines); // skip the header and go directly to the notes var linesWithNotes = lines.Skip(firstNoteLineID).ToList(); //Console.WriteLine(lines[0][1]); //Console.ReadLine(); //return; var sb = new StringBuilder(); sb.Append(header); var linesID = 0; int failsafe = 0; //Console.WriteLine(args[0]);Console.ReadLine(); for(int loopID = 0; linesID < linesWithNotes.Count; loopID++) { failsafe++; if(failsafe > 100) break; if(loopID == 64) { loopID = 0; patternCount++; sb.Append(patternTitle.Replace("XX", patternCount.ToString("X").PadLeft(2, '0'))); }
Reading and Writing Excel Spreadsheets Using ADO.NET C#
Hi all, (apologies if this is in the wrong section)
I am trying to read and write to an excel spreadsheet in c#. I want to put a web form on the front-end that will allow the user to read and write to the spreadsheet.
This is a good tutorial i found: http://davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx
Though i don't know where abouts to put the code.
Any help, any working examples please ?
Thanks in advance.
C# MATH
I'm trying to make an object to follow my mouse I think I'm doing good but I have a little problem
public void main() { try { // main loop ,drawing from first point to the mouse rX = MousePosition.X; rY = MousePosition.Y; Graphics graphicsObj; graphicsObj = this.CreateGraphics(); Pen myPen = new Pen(Color.BlueViolet, 3); Point point = new Point(mX, mY); Rectangle myRectangle = new Rectangle(X, Convert.ToInt16(Y), 50, 50); graphicsObj.Clear(Color.White); mX = myRectangle.X; mY = myRectangle.Y; Y = (X - mX) * ((mY - rY) / (mX - rX)) + mY; graphicsObj.DrawEllipse(myPen, myRectangle); //myRectangle.Location = new Point(X, (X - mX) * ((mY - rY) / (mX - rX)) + mY); label1.Text = "( " + X + " , " + Y + " )" + "( " + rX + " , " + rY + " )"; } catch { } finally { } }
when I tried to find out why the ellipse didn't move in Y-axis I found that Y always zero, can anyone tell me why its equal zero, I have tried the equation many times in paper and it is true but I don't know why it is zero
File corruption over .net sockets
so I made a small P2P Program using TCP, and when I send large files, receiver end gets corrupted data, don't know what I can do to fix, I've been coding since 2015 but haven't really got back fully into it, still know how to code, just a little rusty right now.
here's my code
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace FileBucket.Service {
class SendFileService {
public FileProgressEventHandler FileSendProgress;
public FileSharedCompleteEventHandler FileSendComplete;
public ConnectEventHandler Connect;
public static int bufferSize = 4096;
TcpClient client;
private Task task = null;
public String FilePath { get; set; }
public long FileSize { get; private set; }
public SendFileService(String filePath) {
FilePath = filePath;
FileSize = new FileInfo(filePath).Length;
//Linstener for validation
Task.Run(() => {
TcpListener listener = new TcpListener(4975);
listener.Start();
});
}
public void StartListening() {
Task.Run(() => {
if (Connect != null) Connect(Connection.Connecting);
client = FileShareService.GetNewClient();
if (Connect != null) Connect(Connection.Successful);
});
}
public void SendFileAsync() {
task = Task.Run(() => {
sendFile();
});
}
private void sendFile() {
using (Stream stream = client.GetStream()) {
//Send file size
FileInfo fileInfo = new FileInfo(FilePath);
int fileSize = (int) fileInfo.Length;
byte[] fileSizeBytes = BitConverter.GetBytes(fileSize);
stream.Write(fileSizeBytes, 0, 4);
//Send file name
byte[] fileNamebytes = Encoding.ASCII.GetBytes(fileInfo.Name);
fileSizeBytes = BitConverter.GetBytes(fileNamebytes.Length);
stream.Write(fileSizeBytes, 0, 4);
stream.Write(fileNamebytes, 0, fileNamebytes.Length);
using (FileStream fileStream = new FileStream(FilePath, FileMode.Open)) {
//int count = (int)(fileSize / bufferSize);
//int rest = (int)(fileSize % bufferSize);
//byte[] fileBytes = new byte[bufferSize];
//if (FileSendProgress == null) {
// for (int i = 0; i < count; i++) {
// fileStream.Read(fileBytes, 0, bufferSize);
// System.Threading.Thread.Sleep(10);
// stream.Write(fileBytes, 0, bufferSize);
// }
//} else {
// for (int i = 0; i < count;) {
// fileStream.Read(fileBytes, 0, bufferSize);
// System.Threading.Thread.Sleep(10);
// stream.Write(fileBytes, 0, bufferSize);
// i++;
// FileSendProgress(i / (double)count);
// }
//}
////Rest Bytes
//fileBytes = new byte[rest];
//fileStream.Read(fileBytes, 0, rest);
//stream.Write(fileBytes, 0, rest);
#region
byte[] fileBytes = new byte[fileSize];
fileStream.Read(fileBytes, 0, fileSize);
stream.Write(fileBytes, 0, fileSize);
if (FileSendProgress != null) FileSendProgress(1);
#endregion
}
}
//File send competed
if (FileSendComplete != null) FileSendComplete();
client.Close();
}
public void CancelSending() {
client.Close();
}
}
}
-------
these are split into "services"
-----
using
System
;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace FileBucket.Service {
class ReceiveFileService {
public FileProgressEventHandler FileReceiveProgress;
public FileSharedCompleteEventHandler FileReceivedComplete;
public ConnectEventHandler Connect;
TcpClient client;
public static int bufferSize = 4096;
public String FilePath { get; set; }
public long FileSize { get; private set; }
public String HostName { get; set; }
public bool IsValidHostName() {
try {
TcpClient client = new TcpClient(HostName, 4975);
client.Close();
} catch (Exception e) {
return false;
}
return true;
}
public void ReceiveFileAsync() {
Task.Run(() => {
ReceiveFile();
});
}
public void GetFileInfo() {
client = new TcpClient(HostName, config.Configuration.PORT);
Stream stream = client.GetStream();
//Receive file size
byte[] fileSizeBytes = new byte[4];
stream.Read(fileSizeBytes, 0, 4);
int fileSize = BitConverter.ToInt32(fileSizeBytes, 0);
FileSize = fileSize;
//Receive File name
stream.Read(fileSizeBytes, 0, 4);
int fileNameLen = BitConverter.ToInt32(fileSizeBytes, 0);
byte[] fileNamebytes = new byte[fileNameLen];
stream.Read(fileNamebytes, 0, fileNameLen);
string fileName = Encoding.ASCII.GetString(fileNamebytes);
FilePath = fileName;
}
private void ReceiveFile() {
using (Stream stream = client.GetStream()) {
if (Connect != null) Connect(Connection.Successful);
using (FileStream fileStream = new FileStream(FilePath, FileMode.Create)) {
//int count = (int)(fileSize / bufferSize);
//int rest = (int)(fileSize % bufferSize);
//byte[] fileBytes = new byte[bufferSize];
////TODO hard code replace this
//FilePath = "D:\\downloaded_image.jpg";
//if (FileReceiveProgress == null) {
// for (int i = 0; i < count; i++) {
// stream.Read(fileBytes, 0, bufferSize);
// System.Threading.Thread.Sleep(10);
// fileStream.Write(fileBytes, 0, bufferSize);
// }
//} else {
// for (int i = 0; i < count;) {
// stream.Read(fileBytes, 0, bufferSize);
// System.Threading.Thread.Sleep(10);
// fileStream.Write(fileBytes, 0, bufferSize);
// i++;
// FileReceiveProgress(i / (double)count);
// }
//}
////Rest Bytes
//fileBytes = new byte[rest];
//stream.Read(fileBytes, 0, rest);
//fileStream.Write(fileBytes, 0, rest);
//if (FileReceiveProgress != null) FileReceiveProgress(1);
#region
int fileSize = (int)FileSize;
byte[] fileBytes = new byte[fileSize];
stream.Read(fileBytes, 0, fileSize);
fileStream.Write(fileBytes, 0, fileSize);
if (FileReceiveProgress != null) FileReceiveProgress(1);
#endregion
}
}
//File received complete
if (FileReceivedComplete != null) FileReceivedComplete();
}
}
}
------
using System;using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace FileBucket.Service {
public delegate void FileProgressEventHandler(double progress);
public delegate void FileSharedCompleteEventHandler();
public delegate void ConnectEventHandler(Connection connection);
public enum Connection { Connecting, Successful}
class FileShareService {
private static TcpListener listner;
public static String HostName {
get {
return Dns.GetHostName();
}
}
public static int Port { get; private set; }
public static void StartListener() {
int port = config.Configuration.PORT;
//Generate port number
while (true) {
try {
listner = new TcpListener(port);
listner.Start();
break;
} catch (ArgumentOutOfRangeException outOfRange) {
} catch (SocketException socketException) {
port++;
}
}
Port = port;
}
public static TcpClient GetNewClient() {
return listner.AcceptTcpClient();
}
public static void StopListener() {
listner.Stop();
}
}
}
axis X not not showing when updating a chart.
I got an app that updates a chart with real time data, now i want to be able to add a "tag" to some points, the data comes from serial port, it was working fine and sudently, without me changing configuration from the chart (as far as i can remember) the tags stopped showing, i can see that the tag is added because the chart changes its form to include the tag (the graph moves up to make room for the text) but i can't see the text.
it used to work, and i've even tried adding just a generic string to the graph, still makes the room for it but i can't see the tag, here's what i'm using:
chart1.Series["Series1"].Points.AddXY(tag, data);
chart1.chartAreas[0],AxisX.ScaleView.Position = chart1.Series["Series1"].Points.Count - 500;
my best guess is that some configuration from the graph was changed.
thanks in advance for any help
Not able to print data table value in particular excel column using C#.NET
I am struggling last few days to print data table value in particular excel column.
I have the master table with data.
When i print master table data to excel, there is a condition to swap the column based on the reference table data
and print.
step1
-----
Read the master table. screen shot below
step2
-----
While printing the data into excel, first refer the column as mentioned below and swap the column and then print
step3
-----
Final Output in the excel after swaping the columns.
Note : pls. note down the master table and output in excel, there will be swaping the columns.
since the column has been refrenced.
My Source Code :
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; using Microsoft.Office; namespace WinForm { public partial class Form1 : Form { public string country = string.Empty; public Excel.Application xlApp = null; public Excel.Workbook XLWB = null; public Excel.Worksheet wsht = null; int IdxCurr = 0; int IdxPrev = 0; string colLineNoToPrint; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { country = comboBox1.SelectedItem.ToString(); DataTable boundTable = new DataTable(); DataTable dtRefColumn = RefColumn(); if (!string.IsNullOrEmpty(country)) { IEnumerable<DataRow> query = from customer in dtRefColumn.AsEnumerable() where customer.Field<string>("Country_Name") == country select customer; boundTable = query.CopyToDataTable<DataRow>(); } else { } DataTable dtMaster = dtMasterData(); //print data to output template according to reference column SaveToExcel(dtMaster, dtRefColumn, country); } public void SaveToExcel(DataTable dtMaster, DataTable dtReftable, string country) { xlApp = new Excel.Application(); xlApp.Workbooks.Add(true); wsht = xlApp.Worksheets.Add(); wsht.Name = "S2"; if (dtMaster.Rows.Count > 0) { for (int i = 0; i < dtMaster.Rows.Count; i++) { //************* Struggling to print rows from here **************** DataView dv = new DataView(dtMaster); DataTable dt = dv.ToTable(true, dtMaster.Columns[i].ToString()); //Get Column Name string colname = dtMaster.Columns[i].ToString(); //Get Reference column string RefCol = (dtReftable.AsEnumerable().Where(p => p.Field<string>("Country_Name") == country && p.Field<string>("Column_Name") == colname).Select(p => p.Field<string>("Excel_column"))).FirstOrDefault(); int TotRows = dtMaster.Rows.Count; TotRows = 12 + TotRows; //To Print : Excel rows Should start to print from Rows 10 wsht.Cells[i][10] = dt.Rows[i].ToString(); //************* Struggling to print rows from here **************** } } xlApp.Visible = true; xlApp.ActiveWorkbook.SaveAs(@"C:\Users\CompUMZ1A\Desktop\test.xlsx"); xlApp.Quit(); } public static DataTable dtMasterData() { DataTable tblData = new DataTable(); tblData.Columns.Add("Prod_ID", typeof(string)); tblData.Columns.Add("Prod_Name", typeof(string)); tblData.Columns.Add("Prod_Quantity", typeof(string)); tblData.Columns.Add("Prod_Expiry", typeof(string)); tblData.Columns.Add("Prod_Manf_Date", typeof(string)); tblData.Columns.Add("Prod_Region", typeof(string)); tblData.Columns.Add("Prod_Head", typeof(string)); tblData.Rows.Add("2020-1A", "Horlicks", "5000", "10-Jun-20", "05-Jan-20", "NewYork", "Sharuk"); tblData.Rows.Add("2020-1B", "VIVA", "2000", "10-Jun-20", "05-Jan-20", "California", "Amit"); tblData.Rows.Add("2020-1C", "Complan", "30000", "10-Jun-20", "05-Jan-20", "Mexico", "John"); tblData.Rows.Add("2020-1D", "Bournvita", "10000", "10-Jun-20", "05-Jan-20", "NewJersy", "Rauf"); return tblData; } public static DataTable RefColumn() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("Column_ID", typeof(string)); dataTable.Columns.Add("Column_Name", typeof(string)); dataTable.Columns.Add("Excel_column", typeof(string)); dataTable.Columns.Add("Country_Name", typeof(string)); dataTable.Columns.Add("Status", typeof(string)); dataTable.Rows.Add("Prod_ID", "Prod.No", "H", "USA", "Active"); dataTable.Rows.Add("Prod_Name", "Prod.Name", "A", "USA", "Active"); dataTable.Rows.Add("Prod_Quantity", "Quantity", "C", "USA", "Active"); dataTable.Rows.Add("Prod_Expiry", "Expiry Date", "D", "USA", "Active"); dataTable.Rows.Add("Prod_Manf_Date", "Manufacturing Date", "E", "USA", "Active"); dataTable.Rows.Add("Prod_Region", "Region", "B", "USA", "Active"); dataTable.Rows.Add("Prod_Head", "Head of Region", "G", "USA", "Active"); dataTable.Rows.Add("Prod_ID", "Prod. No", "B", "UK", "Active"); dataTable.Rows.Add("Prod_Name", "Prod. Name", "A", "UK", "Active"); dataTable.Rows.Add("Prod_Quantity", "Quantity", "X", "UK", "Active"); dataTable.Rows.Add("Prod_Expiry", "Expiry Date", "M", "UK", "Active"); dataTable.Rows.Add("Prod_Manf_Date", "Manufacturing Date", "N", "UK", "Active"); dataTable.Rows.Add("Prod_Region", "Region", "O", "UK", "Active"); dataTable.Rows.Add("Prod_Head", "Head of Region", "K", "UK", "Active"); dataTable.Rows.Add("Prod_ID", "Prod. No", "A", "INDIA", "Active"); dataTable.Rows.Add("Prod_Name", "Prod. Name", "B", "INDIA", "Active"); dataTable.Rows.Add("Prod_Quantity", "Quantity", "C", "INDIA", "Active"); dataTable.Rows.Add("Prod_Expiry", "Expiry Date", "D", "INDIA", "Active"); dataTable.Rows.Add("Prod_Manf_Date", "Manufacturing Date", "E", "INDIA", "Active"); dataTable.Rows.Add("Prod_Region", "Region", "F", "INDIA", "Active"); dataTable.Rows.Add("Prod_Head", "Head of Region", "F", "INDIA", "Active"); return dataTable; } private void Form1_Load(object sender, EventArgs e) { comboBox1.Items.Add("USA"); comboBox1.Items.Add("UK"); comboBox1.Items.Add("INDIA"); } } }
pls. have a look inside the code, and let me know where we have to change the code to print appropriate columns in excel...
Waiting for favourable reply.
Howto get the list of files count and Created Date from folder group by Modified date?(C# 3.0 or ASP.Net)
I am trying to find count of all files in folder day wise showed in below image.(expected output)
Could you please help me how to loop all the files in a directory (Folder) to get the count of files and CreatedDate(Day wise).
Attempt : Below is the main method in C Sharp class
staticvoidMain(string[] args){Program p =newProgram();var directory =newDirectoryInfo(@"C:\Test\TestFileCount");var myFile =(from f in directory.GetFiles()orderby f.LastWriteTimedescendingselect f).First();List<FileInfo>FilesInNovember= p.GetFilesByDate(15,@"C:\Test\TestFileCount");Console.WriteLine("Number of files "+"\t"+FilesInNovember.Count+"\t"+"On"+"\t"+ myFile.LastWriteTime.ToString());Console.ReadLine();}
GetFilesByDate method defination
privateList<FileInfo>GetFilesByDate(intDayToGet,string directoryPath){DirectoryInfo dir =newDirectoryInfo(directoryPath);// note use of the option to search sub-directoriesFileInfo[] theFiles = dir.GetFiles("*",SearchOption.AllDirectories);return theFiles.Where(fl => fl.CreationTime.Day==DayToGet).ToList();}
Some links with similar output requirement, but in VB.Net . Getting difficulty to understand it.http://www.codepal.co.uk/show/Show_file_count_and_filesizes_grouped_by_monthly_creation_date_in_ASPNET
Expected Output and Current out put with above code:
CPK
Timeline
Hi
How to create a scrollable video timeline and perform zooming on it using windows form.
Thank you.
Folder Upload using Asp.net c#
Hi,
i have a query on folder upload control using ajax cute UI using asp.net c#.Please suggest me solution
iam able to upload the folder in to a directory inside the project, but not able upload multiple files in folder and refresh second time before inserting clear contents from folder add newly updated multiple files.
Please check for below Code Snippet
void Attachments1_FileUploaded(object sender, UploaderEventArgs args){
var FolderName = txtFontfamily.Text;
string FontPath = Server.MapPath("Fonts") + "\\" + FolderName;
if (System.IO.Directory.Exists(FontPath))
{
//Delete all files from the Directory
foreach (string file in System.IO.Directory.GetFiles(FontPath))
{
System.IO.File.Delete(file);
}
//Delete a Directory
//System.IO.Directory.Delete(FontPath);
}
bool exists = System.IO.Directory.Exists(FontPath);
if (!exists)
System.IO.Directory.CreateDirectory(FontPath);
args.CopyTo(FontPath + "\\" + args.FileName);
}
With Regards,
Sandeep M
[C# / SMO] ExecuteWithResults with GO Statement
Hello,
I'm using SQL Server SMO v150.18208.0 (installed from Nuget) in my C# application.
I've been using server.ConnectionContext.ExecuteNonQuery to run SQL scripts that contain GOstatements, and it works great.
Recently, I also discovered ExecuteWithResults methods which works(in order to get SELECT result sets), but only when the script doesn't have any GO statement, otherwise, I run into "Incorrect syntax near 'GO'" error.
Is this something normal or is it a bug ? If not, is there a way to avoid this behavior ?
Thanks.
General Questions About C# High Performance
When you make a performance you can use the syntax code Stopwatch() to make a measurement but I have some general question about it.
1.
Should you use the syntax code "Stopwatch stopwatch = new Stopwatch();" in production phase. I have heard that this syntax takes a lot performance.
Is there another approach to use it?
2.
Is there any other option / tool that is not to use "Stopwatch stopwatch = new Stopwatch();" in order to make a mesurement?
3.
Is there any other advice that I should be aware about high performance?
Thank you!
Recommended c# Syntax Code for High Performance
There are some syntax that you should not use for instance "foreach" is takes a lot of resources compare to "for (in i=0; i < 10; i++)"
Another approach is to use array index instead of using "List<T>"
Do you know anythong more about similiar of syntax code that is not usage to use and also syntax code is recommended to use?
Thank you!
About .Net Standard
I have some reflective questions:
1.
What is the benefit to use .net standard?
2.
What context is recommended to use .net standard?
3.
When should you use .net standard?
4.
Do you have a sample when you use .net standard in relation to the existing solution and its project?
Thank you!
Get list of scheduled task in the local machine
Hi,
I am trying to schedule a task via c# code(winforms). But before creating I would like to check whether a task of the same name already exists. I am trying to get a list of tasks using schtasks /query. But it gives other information as well ,like HostName, Status etc. I need only the list of TaskNames.
I tried the code as shown below. The strOutput shows headers, status, hostname and next time run along with TaskName. I need only Tasknames. Help would be appreciated.
private
void button1_Click(object sender, EventArgs e){
ProcessStartInfo psi = newProcessStartInfo("SCHTASKS", "/QUERY /fo table");psi.RedirectStandardOutput =
true;psi.UseShellExecute =
false;Process p = Process.Start(psi);p.OutputDataReceived +=
newDataReceivedEventHandler(p_OutputDataReceived);p.BeginOutputReadLine();
}
void p_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
//string str = "";strOutput += e.Data+
",";}
privatevoid button2_Click(object sender, EventArgs e){
label1.Text = strOutput;
}
System.Data.SqlClient.SqlException:Login failed for user
Hi Team
I am experince this issue close to a day and half now, no one seem to help. Basically i am using MVC to develop user registration to the dashboard. The problem is on my AuthConfig.cs under AppStart folder, here is my logic below;
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Microsoft.Web.WebPages.OAuth;
using WebMatrix.WebData;
namespace eNtsaPortalWebsiteProject
{
public class AuthConfig
{
public static void RegisterAuth()
{
WebSecurity.InitializeDatabaseConnection("MyString", "Users", "UserName", "FullName", autoCreateTables: true);
}
}
}