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
Ali G
NA
51
38.2k
GETTING DATA FROM SQL COMPACT
Jan 2 2013 6:25 AM
I have 2 listboxes in a form. They uses data bound items.
My listboxes gets the values problem free. My database is here:
My databse properties including path is here:
In my software philosophy user select a value (comes from fldUnitName) from listBox1 and according to selected item I must get the fldCoefficient from the table. And I will assign this fldCoefficient value to a double like Double DoubleKatsayi1= (The Value comes from fldCoefficient)
And After same process for listBox2 selection I must have a DoubleKatsayi2.
I know all codes are a few lines but because I am newbee I couldn't write. FOr a starting point I am writing some codes here. Can you edit it?
//CODES BEGIN:
using System.Data.SqlServerCe;
SqlCeConnection conn = new SqlCeConnection("Data Source=unitsdb.sdf");
conn.Open();
string sql1 = "SELECT * FROM tblAcceleration WHERE fldUnitName =" + "' listBox1.SelectedItem +'";
string sql2 = "SELECT * FROM tblAcceleration WHERE fldUnitName =" + "' listBox2.SelectedItem +'";
SqlCeCommand cmd1 = new SqlCeCommand(sql1, conn);
SqlCeDataReader r1 = cmd1.ExecuteReader();
SqlCeCommand cmd2 = new SqlCeCommand(sql2, conn);
SqlCeDataReader r2 = cmd2.ExecuteReader();
conn.Close();
Double DoubleKatsayi1 = .............;
Double DoubleKatsayi2 = .............;
//CODES END
Note: To see the large images drag and drops them to the browser.
Reply
Answers (
0
)
sliding form
How to maintain size of controls according to fonts size