JG Vimalan's Blog

It is all about coding!

Using Borland BdpParameter

The following code snippet will give you an idea on coding with BdpParameter, 

       public int GetEmployeeCountByGrade(int gradeValue)
        {
            Borland.Data.Provider.BdpCommand command = new
                Borland.Data.Provider.BdpCommand();
            command.CommandText = string.Format(
                “SELECT COUNT(*) FROM {0} WHERE {0}.{1} = ?”,
                Employee,     // 0
                Grade // 1
            );
            Borland.Data.Common.BdpParameter parameter = new 

            Borland.Data.Common.BdpParameter(
                “GRADE”,
                Borland.Data.Common.BdpType.Int32
            );
            parameter.Value = gradeValue;
            command.Parameters.Add(parameter);
            command.Connection = this.Connection;
            return (int)command.ExecuteScalar();
        }

Advertisements

October 9, 2009 - Posted by | Interbase

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: