.NET

Embedded Database For .NET

One of the major fights I had while making a jump from Delphi programming to C# and .NET was the one related to embedded databases. In Delphi there are many options and I’ve used most of them in my programming endeavors. On the other side, .NET  seems poor by comparison. However, I discovered that one of the solutions I used with Delphi also supports .NET languages.

Firebird project seems to have an embeddable library for .NET available. I’ve successfully used Firebird database in my Delphi projects in the past and it was the perfect solution for a client-server architecture I’ve developed.

This database engine has a strong community behind it and it’s  continuously developed further and further. Also, there are a lot of tools to manage firebird databases, some of them completely free. Deployment of a Firebird based application is simplified as the entire database is encapsulated in one single file and the actual DB engine consists of a single dll.

As a bonus, Firebird has one of the most relaxed license possible (basically you can use it for whatever purposes) :D .

So, long story short,  for anybody looking for an embeddable database for .NET just check the Firebird Project’s page .

  • Share/Bookmark

Tags: , ,

Saturday, September 12th, 2009 .NET, Delphi 1 Comment

.NET Form Transparency

A little tip on the .NET Form Transparency.
The following code shall provide a simple way to adjust the form transparency using the mouse wheel button.

//=== in the initialization section insert this:

this.MouseWheel += new MouseEventHandler(TransparencyHandle);

//=== in the form’s class :
private void TransparencyHandle(object sender, MouseEventArgs e)
{
if (e.Delta > 0)
{
this.Opacity = this.Opacity + 0.05;
}
else
{
this.Opacity = this.Opacity – 0.05;
}
}
This should do it.

  • Share/Bookmark

Tags: , , , , ,

Friday, April 11th, 2008 .NET No Comments

.NET TEXT-TO-SPEECH example

Some methods to implement text-to-speech in a .NET application:

?View Code CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public void Sing(string vMessage)
{
    BackgroundWorker bw = new BackgroundWorker();
    bw.DoWork += new DoWorkEventHandler(bw_DoWork);
    bw.RunWorkerAsync(vMessage);
}
 
private static void bw_DoWork(object sender, DoWorkEventArgs e)
{
    SpVoice voice = new SpVoice();
    voice.Speak(e.Argument.ToString(), SpeechVoiceSpeakFlags.SVSFDefault); 
}
 
Sing("Hello");
  • Share/Bookmark

Tags: , , , , ,

Friday, April 11th, 2008 .NET No Comments

.NET DataSet Creation

private void GetData(string selectCommand)
{
try
{
// Specify a connection string. Replace the given value with a
// valid connection string for a Northwind SQL Server sample
// database accessible to your system.
String connectionString =
“Integrated Security=SSPI;Persist Security Info=False;” +
“Initial Catalog=Northwind;Data Source=localhost”;

// Create a new data adapter based on the specified query.
dataAdapter = new SqlDataAdapter(selectCommand, connectionString);

// Create a command builder to generate SQL update, insert, and
// delete commands based on selectCommand. These are used to
// update the database.
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);

// Populate a new data table and bind it to the BindingSource.
DataTable table = new DataTable();
table.Locale = System.Globalization.CultureInfo.InvariantCulture;
dataAdapter.Fill(table);
bindingSource1.DataSource = table;

// Resize the DataGridView columns to fit the newly loaded content.
dataGridView1.AutoResizeColumns(
DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
}
catch (SqlException)
{
MessageBox.Show(“To run this example, replace the value of the ” +
“connectionString variable with a connection string that is ” +
“valid for your system.”);
}
}

  • Share/Bookmark

Tags: , ,

Friday, April 11th, 2008 .NET No Comments