Click here to Skip to main content
14,836,067 members
Home / Discussions / C#
   

C#

 
GeneralRe: invalid path using process.start method Pin
Mogaambo4-Aug-08 23:46
MemberMogaambo4-Aug-08 23:46 
GeneralRe: invalid path using process.start method Pin
stephan_0075-Aug-08 1:12
Memberstephan_0075-Aug-08 1:12 
GeneralRe: invalid path using process.start method Pin
stephan_0075-Aug-08 2:41
Memberstephan_0075-Aug-08 2:41 
GeneralRe: invalid path using process.start method Pin
stephan_0075-Aug-08 11:22
Memberstephan_0075-Aug-08 11:22 
AnswerRe: invalid path using process.start method Pin
astanton19785-Aug-08 2:50
Memberastanton19785-Aug-08 2:50 
QuestionWhy the error message like "Object reference not set to an instance" comes.. Pin
Samiullah4-Aug-08 21:46
MemberSamiullah4-Aug-08 21:46 
AnswerRe: Why the error message like "Object reference not set to an instance" comes.. Pin
Mogaambo4-Aug-08 22:09
MemberMogaambo4-Aug-08 22:09 
GeneralRe: Why the error message like "Object reference not set to an instance" comes.. Pin
Samiullah4-Aug-08 22:17
MemberSamiullah4-Aug-08 22:17 
private void findbutton_Click(object sender, EventArgs e)
{
SqlDataReader rdr = null;
SqlConnection con = null;
SqlCommand cmd = null;

try
{
// Open connection to the database

string ConnectionString = "server=INDUS-SERVER;uid=sa;pwd=victory;database=northwind";
con = new SqlConnection(ConnectionString);
con.Open();

// Set up a command with the given query and associate
// this with the current connection.

string CommandText = "SELECT FirstName, LastName" + "FROM Employees" + "WHERE (LastName LIKE @Find)";
cmd = new SqlCommand(CommandText);
cmd.Connection = con;

// Add LastName to the above defined paramter @Find
cmd.Parameters.Add(
new SqlParameter(
"@Find", // The name of the parameter to map
System.Data.SqlDbType.NVarChar, // SqlDbType values
20, // The width of the parameter
"LastName")); // The name of the source column

// Fill the parameter with the value retrieved
// from the text field
cmd.Parameters["@Find"].Value = txtFind.Text;

// Execute the query
rdr = cmd.ExecuteReader();

// Fill the list box with the values retrieved
lblFound.Items.Clear();

while (rdr.Read())
{
lblFound.Items.Add(rdr["FirstName"].ToString() + " " + rdr["LastName"].ToString());
}
}
catch (Exception ex)
{
// Print error message
MessageBox.Show(ex.Message);
}
finally
{
// Close data reader object and database connection
if (rdr != null)
rdr.Close();

if (con.State == ConnectionState.Open)
con.Close();
}
GeneralRe: Why the error message like "Object reference not set to an instance" comes.. Pin
Vimalsoft(Pty) Ltd4-Aug-08 22:56
professionalVimalsoft(Pty) Ltd4-Aug-08 22:56 
GeneralRe: Why the error message like "Object reference not set to an instance" comes.. Pin
Samiullah5-Aug-08 1:14
MemberSamiullah5-Aug-08 1:14 
GeneralRe: Why the error message like "Object reference not set to an instance" comes.. Pin
AtulRane5-Aug-08 1:23
MemberAtulRane5-Aug-08 1:23 
Questionuser interacting windows forms Pin
prasadbuddhika4-Aug-08 21:30
Memberprasadbuddhika4-Aug-08 21:30 
AnswerRe: user interacting windows forms Pin
Syed Shahid Hussain4-Aug-08 22:49
MemberSyed Shahid Hussain4-Aug-08 22:49 
GeneralRe: user interacting windows forms Pin
prasadbuddhika6-Aug-08 21:56
Memberprasadbuddhika6-Aug-08 21:56 
QuestionResizing TextBox while resizing window Pin
Admin8874-Aug-08 21:16
MemberAdmin8874-Aug-08 21:16 
AnswerRe: Resizing TextBox while resizing window Pin
N a v a n e e t h4-Aug-08 21:35
MemberN a v a n e e t h4-Aug-08 21:35 
QuestionOracle 7.3.4 Pin
kodali ranganadh4-Aug-08 21:16
Memberkodali ranganadh4-Aug-08 21:16 
Questionautomatic updates Pin
laziale4-Aug-08 21:05
Memberlaziale4-Aug-08 21:05 
AnswerRe: automatic updates Pin
selcuks4-Aug-08 21:16
Memberselcuks4-Aug-08 21:16 
Questionabout regex: I couldn't understand why it takes 2-10 minutes? [modified] Pin
enginço4-Aug-08 20:33
Memberenginço4-Aug-08 20:33 
AnswerRe: about regex: I couldn't understand why it takes 2-10 minutes? Pin
PIEBALDconsult5-Aug-08 8:14
professionalPIEBALDconsult5-Aug-08 8:14 
GeneralRe: about regex: I couldn't understand why it takes 2-10 minutes? [modified] Pin
enginço5-Aug-08 21:26
Memberenginço5-Aug-08 21:26 
GeneralRe: about regex: I couldn't understand why it takes 2-10 minutes? [modified] Pin
enginço5-Aug-08 23:47
Memberenginço5-Aug-08 23:47 
QuestionGet Row ID in KeyPress event [modified] Pin
M Riaz Bashir4-Aug-08 20:23
MemberM Riaz Bashir4-Aug-08 20:23 
AnswerRe: Get Row ID in KeyPress event Pin
cocoonwls4-Aug-08 22:13
Membercocoonwls4-Aug-08 22:13 

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.