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
MoonDay
NA
1
896
Open a link from MS-Access database file
Mar 9 2014 7:12 AM
Hi
Why this code return two string from database? p as string fill with an address like: F:\Database\Balah#F:\Database\Balah#
DataSet DSOne = new DataSet();
OleDbDataAdapter adp = new OleDbDataAdapter();
private void button2_Click(object sender, EventArgs e)
{
adp.SelectCommand = new OleDbCommand();
adp.SelectCommand.Connection = oleDbConnection1;
adp.SelectCommand.CommandText = @"SELECT Folder FROM Movakelin
WHERE OfficeNumber LIKE ? or OfficialDossier LIKE ? or Family LIKE ? or
FirstName LIKE ? or approve LIKE ? or Folder LIKE ? or City LIKE ? or
Department LIKE ? or Organization LIKE ?";
string parameterValue = "%" + textBox1.Text + "%";
adp.SelectCommand.Parameters.AddWithValue("@p1", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p2", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p3", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p4", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p5", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p6", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p7", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p8", parameterValue);
adp.SelectCommand.Parameters.AddWithValue("@p9", parameterValue);
adp.Fill(DSOne, "Folder");
if (DSOne.Tables[0].Rows.Count > 0)
{
string p = DSOne.Tables[0].Rows[0]["Folder"].ToString();
string args = string.Format("/e, /select, \"{0}\"", p);
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "explorer";
info.Arguments = args;
Process.Start(info);
}
}
Reply
Answers (
1
)
How do I get certain code to onto the next line
Accessing the web cam