Click here to Skip to main content
15,888,069 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
nstk26-May-11 6:22
nstk26-May-11 6:22 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
Mark Salsbery26-May-11 11:04
Mark Salsbery26-May-11 11:04 
GeneralRe: Problem when starting Windows Phone 7 Emulator [modified] Pin
nstk27-May-11 1:33
nstk27-May-11 1:33 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
Mark Salsbery27-May-11 9:14
Mark Salsbery27-May-11 9:14 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
nstk28-May-11 3:09
nstk28-May-11 3:09 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
Mark Salsbery28-May-11 5:42
Mark Salsbery28-May-11 5:42 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
nstk28-May-11 21:41
nstk28-May-11 21:41 
QuestionDataReader To DataTable Pin
Alexandra - Marie Schembri26-May-11 1:22
Alexandra - Marie Schembri26-May-11 1:22 
SqlConnection conn = new SqlConnection("");

conn = DataHandler.conn;

String username = txtUsername.Text;
String password = txtPassword.Text;
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM [TBLUsers]", conn);
cmd.Connection = conn;
DataTable table = new DataTable();
SqlDataReader reader = null;
reader = cmd.ExecuteReader();


while (reader.Read())
{

if (txtUsername.Text == (reader["UserName"].ToString()) && txtPassword.Text = reader["Password"].ToString()))
{
reader.Dispose();
table.Load(reader);
POS2 p = new POS2();
MainPage page = (MainPage)this.MdiParent;
p.MdiParent = page;
p.WindowState = FormWindowState.Maximized;
p.Show();
page.WelcomeUser = reader["UserName"].ToString();

//throw new CustomException("Enter Correct Username and Password");

}
}

I'm getting this error-->Invalid attempt to call MetaData when reader is closed.

What can i do??
thanks in advance
Sandra

AnswerRe: DataReader To DataTable Pin
Blue_Boy26-May-11 1:28
Blue_Boy26-May-11 1:28 
AnswerRe: DataReader To DataTable [modified] Pin
Luc Pattyn26-May-11 1:41
sitebuilderLuc Pattyn26-May-11 1:41 
AnswerRe: DataReader To DataTable Pin
PIEBALDconsult26-May-11 2:51
mvePIEBALDconsult26-May-11 2:51 
AnswerRe: DataReader To DataTable Pin
Dhyanga26-May-11 4:43
Dhyanga26-May-11 4:43 
GeneralRe: DataReader To DataTable Pin
Luc Pattyn26-May-11 5:31
sitebuilderLuc Pattyn26-May-11 5:31 
GeneralRe: DataReader To DataTable Pin
Dhyanga26-May-11 6:13
Dhyanga26-May-11 6:13 
AnswerRe: DataReader To DataTable Pin
Luc Pattyn26-May-11 6:24
sitebuilderLuc Pattyn26-May-11 6:24 
GeneralRe: DataReader To DataTable Pin
Alexandra - Marie Schembri26-May-11 7:40
Alexandra - Marie Schembri26-May-11 7:40 
QuestionHow to consume XML Web Services with Parameters Pin
samir.abda25-May-11 17:27
samir.abda25-May-11 17:27 
AnswerRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 18:50
Mark Salsbery25-May-11 18:50 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 21:16
samir.abda25-May-11 21:16 
GeneralRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 21:27
Mark Salsbery25-May-11 21:27 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 21:51
samir.abda25-May-11 21:51 
QuestionRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 22:03
Mark Salsbery25-May-11 22:03 
AnswerRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 22:19
samir.abda25-May-11 22:19 
GeneralRe: How to consume XML Web Services with Parameters [modified] Pin
Mark Salsbery25-May-11 22:27
Mark Salsbery25-May-11 22:27 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 22:46
samir.abda25-May-11 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.