TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adesanya Olusegun
NA
19
26.6k
input string does not contain a valid encoding of the 'RSA'
May 26 2014 8:58 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.ComponentModel;
using System.Threading;
namespace DiaryApps
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
bool InstanceCountOne = false;
using (Mutex mtex = new Mutex(true, "DiaryApps", out InstanceCountOne))
{
if (InstanceCountOne)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RegistrationForm());
// what am trying to do here is load the registration page once and to load the Login page for other subsequent logins
OleDbConnection newConnection;
OleDbCommand cmd = new OleDbCommand();
string Connection = @" provider=Microsoft.Jet.OLEDB.4.0; data source='Diarydatabase.mdb'; Jet OLEDB:Database Password= segunsco";
newConnection = new OleDbConnection(Connection);
newConnection.Open();
cmd.CommandText = "if exist(select Flag from createdDetails) begin select '1' end else begin select '0' end";
OleDbDataReader MotReader = cmd.ExecuteReader();
if (MotReader.HasRows)
{
while (MotReader.Read())
{
string ty = MotReader.GetString(0);
if (ty == "0")
{
Application.Run(new RegistrationForm());
}
else if (ty == "1")
{
Application.Run(new Login());
}
}
}
}
else
{
MessageBox.Show("An instance of the application is already running");
}
}
}
}
}
Reply
Answers (
0
)
Text to Speech ,C#,Other Languages
input string does not contain a valid encoding of the 'RSA'