Click here to Skip to main content
15,895,799 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to perform Database Update with out using controls or SQL commnads using ADO.NET Pin
Rob Graham22-Jul-05 5:10
Rob Graham22-Jul-05 5:10 
GeneralADO 2.8 Connection Object Closing SQL Server Connection Pin
QuintesV21-Jul-05 5:12
QuintesV21-Jul-05 5:12 
GeneralRe: ADO 2.8 Connection Object Closing SQL Server Connection Pin
Rob Graham21-Jul-05 5:46
Rob Graham21-Jul-05 5:46 
GeneralRe: ADO 2.8 Connection Object Closing SQL Server Connection Pin
QuintesV21-Jul-05 21:10
QuintesV21-Jul-05 21:10 
GeneralRe: ADO 2.8 Connection Object Closing SQL Server Connection Pin
Rob Graham22-Jul-05 10:54
Rob Graham22-Jul-05 10:54 
GeneraldataReader not executing properly Pin
WetRivrRat21-Jul-05 3:54
WetRivrRat21-Jul-05 3:54 
GeneralRe: dataReader not executing properly Pin
Rob Graham21-Jul-05 6:22
Rob Graham21-Jul-05 6:22 
GeneralRe: dataReader not executing properly Pin
WetRivrRat22-Jul-05 9:49
WetRivrRat22-Jul-05 9:49 
Rob,
finally got a chance to plug this in and i'm having some problems....
i get a specified cast is not valid on the string thePwd = (string)o ; it looks like it is creating the thePwd as null rather than failing at the first if.
I've enclosed the whole try/catch block. also want to note that i WAS able to run the if statements properly if the data field was NOT null, but when i set it to null i get the cast not valid error. code is shown as tested, have not begun to add the commented areas yet.
thanks
try  
{ 
object o  = dataCommand.ExecuteScalar();
if(o == null)//if null then software has been installed already
{
//dataCommand.CommandText = "SELECT password, FROM users_id WHERE username = '"+ fp.Value() +"' ";
//object p  = dataCommand.ExecuteScalar();				
//if (p.ToString() == fp.Value())//verify that the machine has been logged in before
//{
//	LogTransAxs();//log this transaction
//dataConnection.Close(); 
//dataConnection.Dispose();
//	InitializeComponent();//start the program
//	Connection();//load the treeview
//}
//else// did not verify the machine had logged in before
//{
InitializeComponent2();//show the logoff screen/window
dataConnection.Close(); 
dataConnection.Dispose();
}				
else   
{ 
string thePwd =(string)o ;
if(thePwd.Equals("board"))
{						
dataConnection.Close(); //close the Scalar connection
dataConnection.Dispose();
InitializeComponent();//start the program
InitialTransAxs();//log the initial entry to the user_id tbl for use later to verify machine has logged in before
Connection();//load the treeview			
}  
}  
}
catch (Exception e)
{
MessageBox.Show("(003) Sorry you are not authorized to view this material." +e.Message +e.StackTrace);
}
finally 
{ 
dataConnection.Close(); 
dataConnection.Dispose();
}


Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."


Why is common sense such an un-common comodity?
GeneralRe: dataReader not executing properly Pin
Rob Graham22-Jul-05 10:42
Rob Graham22-Jul-05 10:42 
GeneralRe: dataReader not executing properly Pin
WetRivrRat22-Jul-05 10:48
WetRivrRat22-Jul-05 10:48 
GeneralRe: dataReader not executing properly Pin
Rob Graham22-Jul-05 11:13
Rob Graham22-Jul-05 11:13 
GeneralHelp About Working with DataBases Pin
korso_rogan20-Jul-05 23:21
korso_rogan20-Jul-05 23:21 
QuestionHow can i clear all database connection via t-sql script Pin
m.rastgar20-Jul-05 20:28
m.rastgar20-Jul-05 20:28 
AnswerRe: How can i clear all database connection via t-sql script Pin
Alomgir Miah21-Jul-05 4:10
Alomgir Miah21-Jul-05 4:10 
GeneralRe: How can i clear all database connection via t-sql script Pin
m.rastgar21-Jul-05 11:59
m.rastgar21-Jul-05 11:59 
GeneralRe: How can i clear all database connection via t-sql script Pin
Alomgir Miah22-Jul-05 5:59
Alomgir Miah22-Jul-05 5:59 
GeneralRe: How can i clear all database connection via t-sql script Pin
Alomgir Miah22-Jul-05 10:02
Alomgir Miah22-Jul-05 10:02 
GeneralRe: How can i clear all database connection via t-sql script Pin
m.rastgar22-Jul-05 12:17
m.rastgar22-Jul-05 12:17 
Questionhow to serialize (save) object into SQL Server? Pin
maaaxwell20-Jul-05 16:02
maaaxwell20-Jul-05 16:02 
AnswerRe: how to serialize (save) object into SQL Server? Pin
Christian Graus20-Jul-05 17:27
protectorChristian Graus20-Jul-05 17:27 
GeneralRe: how to serialize (save) object into SQL Server? Pin
maaaxwell21-Jul-05 15:32
maaaxwell21-Jul-05 15:32 
GeneralRe: how to serialize (save) object into SQL Server? Pin
Christian Graus21-Jul-05 16:21
protectorChristian Graus21-Jul-05 16:21 
GeneralDynamically creating DTS package Pin
Martin@captivasystems20-Jul-05 9:30
Martin@captivasystems20-Jul-05 9:30 
GeneralRe: Dynamically creating DTS package Pin
ToddHileHoffer21-Jul-05 10:00
ToddHileHoffer21-Jul-05 10:00 
GeneralRounding Problem of DateTime field Pin
zsharon1120-Jul-05 4:22
zsharon1120-Jul-05 4:22 

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.