public virtual object Estado() { global::System.Data.OleDb.OleDbCommand command = ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[0])); global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { command.Connection.Open(); } object returnValue; try { returnValue = command.ExecuteScalar(); } finally { if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { command.Connection.Close(); } } if (((returnValue == null) || (returnValue.GetType() == typeof(global::System.DBNull)))) { return(null); } else { return((object)(returnValue)); } }
public object LastID() { global::System.Data.OleDb.OleDbCommand command = adapter.SelectCommand; global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { command.Connection.Open(); } object returnValue; try { returnValue = command.ExecuteScalar(); } finally { if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { command.Connection.Close(); } } if (((returnValue == null) || (returnValue.GetType() == typeof(global::System.DBNull)))) { return(null); } else { return((object)(returnValue)); } }
public void fillformyquery(StackOverflowWin.DataSet1.EmpDataTable emp1) { System.Data.OleDb.OleDbCommand[] mycol = new System.Data.OleDb.OleDbCommand[1]; mycol[0] = new global::System.Data.OleDb.OleDbCommand(); mycol[0].Connection = this.Connection; mycol[0].CommandText = "Select * from emp where name = '%alliswell%'"; mycol[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection = mycol; //this._commandCollection = new System.Data.OleDb.OleDbCommand[1]; this.Fill(emp1); }