The main goal of Snotra Tech Oracle Data Components is negotiation of most restrictions of ADO.NET disconnected model. Those components are compatible with ADO.NET interfaces and could be used as data sources for such visual components as DataGridView, ComboBox and etc. But in contrast to disconnected DataTable, the STOraDataTable from this set of components use connected model and has number of useful features those are absent in ADO.NET. Complete information you can find on official product site: http://www.snotratech.com.
Snotra Tech Oracle Data Components can be downloaded from here: http://www.snotratech.com/products/snocnetdemo.exe (9,5 MB). Also it takes ODP.NET as data provider so ODP.NET should be installed on your PC also.
As an alternative, or if you don't have ODP.NET installed on your PC you can download Adonet Oracle Data Components. Unlike Snotra Tech Oracle Data Components, Adonet Oracle Data Components don't take ODP.NET and use Microsoft .NET Managed Provider for Oracle that is a part of .NET 2.0 distributions, so no additional software required. One can download Adonet Oracle Data Components from here: http://www.snotratech.com/products/snocnet_adonet_demo.exe(2,9 MB).
Let's making the same application with DataGridView and button "RefreshCurrentRow" on Form. We should add two references: Oracle.DataAccess.dll (2.102.2.20) from ODP.NET and Snotra.Data.dll (2.10.2.3) from Snotra Tech Oracle Data Components. (System.Data.OracleClient and Snotra.Data.OracleClient if you use Adonet Oracle Data Components). Also you should add following "using" in your code:
using Snotra.Data; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types;or
using Snotra.Data; using Snotra.Data.OracleClient; using System.Data.OracleClient;if you use Adonet Oracle Data Components.
Below you can see complete application code:
namespace WindowsApplicationSnotra
{
public partial class Form1 : Form
{
STOracleConnection conn; //STAdonetOracleConnection if you use Adonet Oracle Data Components
STOraDataTable stOraDataTable; // STAdonetOraDataTable if you use Adonet Oracle Data Components
public Form1()
{
InitializeComponent();
string connectStr = "User Id=scott;Password=tiger;Data Source=orcl";
conn = new STOracleConnection(); //STAdonetOracleConnection() if you use Adonet Oracle Data Components
conn.ConnectionString = connectStr;
//open the connection
conn.Open();
stOraDataTable = new STOraDataTable(); //STAdonetOraDataTable() if you use Adonet Oracle Data Components
stOraDataTable.STOracleConnection = conn; //stOraDataTable.STAdonetOracleConnection if you use Adonet Oracle Data Components
stOraDataTable.SQL = "select t.*, t.rowid from colors t";
//instead of using BindingManager
stOraDataTable.BindingControl = dataGridView1;
//to prevent throw exceptions to application if you don't have default
// exceptions handler
stOraDataTable.ThrowExceptions = false;
//set stOraDataTable as datasource for dataGridView1
dataGridView1.DataSource = stOraDataTable;
//open STOracleDataTable
stOraDataTable.Open();
}
private void button1_Click(object sender, EventArgs e)
{
stOraDataTable.RefreshRecord();
}
}
}
With very few of code we get working application that can refresh row automatically and also has another extra features. Compile and run application, you should see the same form as in our previous program. Of course we should test it. Let's turning back our black color, so start sqlplus and execute command:
update colors set red=0, green=0, blue=0 where color_id=1; commit;Then select row in DataGridView push "RefreshCurrentRow" button and run cursor to another row. Row should be refreshed. You can mention that STOraDataTable hides ROWID field because it don't have useful visual information for user. Let's walking a bit forward and trying to change COLOR_ID field from DataGridView. Suppose we decided to change COLOR_ID from 3 to 1. It should raise unique constraint violation. Common do it. We should get error as in following picture:

STOracleDataSet uses connected model so it know about all oracle constraints and informs user about them immediately. When you push "OK", DataGridView cursor will be returned to row where exception has been raised. This feature is very useful when user type data in DataGridView, on can see and correct errors immediately.
This article doesn't have a goal to light up all features of Snotra Tech Oracle Data Components, so in my next articles I will give more information, but please feel free to ask me or express your opinion by mail: michael.milonov@snotratech.com.
To write effective SQL code we suggested to not making a cure all and the solution that we offer nowadays is suitable for Oracle database only, but this restriction is temporary. Snotra Tech Oracle Data Components is shareware licensed, but we have a number of free licenses and ready to deliver this soft for interested persons for free. We welcome any suggestions and opinions and glad to answers your questions by mail: info@snotratech.com.
Michael Milonov
CEO, Snotra Tech