OleDbConnection thisConnection = new OleDbConnection( @"Provider = Microsoft.Jet.OLEDB.4.0;Data Source=e:\DataMoney.mdb"); OleDbDataAdapter thisAdapter = new OleDbDataAdapter( "SELECT * FROM SchoolMoney", thisConnection); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "SchoolMoney"); OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter); thisBuilder.QuotePrefix = "["; thisBuilder.QuoteSuffix = "]"; //set up keys object for defining primary key DataColumn[] keys = new DataColumn[1]; keys[0] = thisDataSet.Tables["SchoolMoney"].Columns[0]; thisDataSet.Tables["SchoolMoney"].PrimaryKey = keys; DataRow findRow = thisDataSet.Tables["SchoolMoney"].Rows.Find(this.textBox1.Text); if (findRow != null) { // } thisConnection.Close(); } } } can you tell me how i get the number of row about findRow thank you
clj19870503
Posts
-
about DataRow -
Excel and C#hello, i want to guide dates from Excel to use in C# Form . can you tell me how to do ? or, i should look which books ? thank you
-
about dynamic change a expressions in methodshello, for example, i have three Textbox and a button int the Form(textBox1,textBox2,textBox3, button2). private void button2_Click(object sender, EventArgs e) { int temp; temp = int.Parse(textBox2.Text) + int.Parse(textBox1.Text); textBox3.Text = temp.ToString(); } A question is : i have two roles (system administrator and commmon user) in this software. if i have written this button2_Click(), can i let system administrator change button2_Click() when software is running. eg,temp = int.Parse(textBox2.Text) * int.Parse(textBox1.Text); instead of temp = int.Parse(textBox2.Text) + int.Parse(textBox1.Text); thank you
-
about array and propertyfor exampel , do i use this : this.testProtery[0].TestProtery; i don't understand, thank you .
-
about array and propertyif i use this code, do it have no sense private int[] testProtery = new int[3]; public int[] TestProtery { get { return this.testProtery; } set { this.testProtery = value; } } i want to uee the property to match the private filed of testProtery, i feel this code don't work. please let me understand. thank you
-
about const member functionclass Text { public: void bad( const string &parm ) const; private: char *_text; }; void Text::bad( const string &parm ) const { _text = parm.c_str(); // error: _text cannot be modified for ( int ix = 0; ix < parm.size(); ++ix ) _text[ix] = parm[ix]; // bad style but not an error } this example show a pointer refer change a data member in the const member function , why?