Click here to Skip to main content
15,883,745 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
i want to create an application for my windows emulator to scan barcode etc,but i tried using Oracle.DataAccess.Client; but unable to build its showing error
"The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly" i think this component is only for desktop applications. so i google and found Devart dotConnect for oracle now i am able to build and run the application. but as soon as i am opening the connection its giving me the error "Licence not found" i have read all the documents and followed all the process mentioned here[^]to compile license manually and added as resource the .licenses file but still i am facing the same error

here is my code
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Devart.Data.Oracle;
//using Oracle.DataAccess.Client;
namespace IBT_Windows_Emulator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        OracleConnection con;
        OracleCommand cmd;
        OracleDataReader dr;

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                OracleConnectionStringBuilder oraCSB = new OracleConnectionStringBuilder();
                //oraCSB.Direct = true;
                oraCSB.Server = "***.**.**.51";
                oraCSB.Port = 1521;
                oraCSB.Sid = "***";
                oraCSB.UserId = "*****";
                oraCSB.Password = "*****";
                con = new OracleConnection(oraCSB.ConnectionString);
                con.Open();                
                string str = "select distinct store_name3 from store";
                cmd = new OracleCommand(str, con);
                dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    comboBox1.Items.Clear();
                    while (dr.Read())
                    {
                        comboBox1.Items.Add(dr[0].ToString());
                    }
                    MessageBox.Show("Added");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "error");
            }

        }

        
    }
}


please help me is there any other component available to connect its Oracle 10g
thanks in advance.
Posted
Updated 1-Jan-15 3:03am
v4
Comments
OriginalGriff 1-Jan-15 9:12am    
Stop "bumping" your question.
By all means, make changes to add information, but just editing it to bring it to the top of the queue does not improve your chances of an answer - it can in fact reduce it, as you can come over as rude and arrogant.
Basmeh Awad 7-Jan-15 1:59am    
With due respect,
is this the reason you down voted my question?
i have updated it twice only!! once i posted a question twice so you commented not to post again but to update and now when i am following this you are down voting question. and this is the only information i can provide
OriginalGriff 7-Jan-15 3:59am    
The system tracks all changes, and allows us to review them.
The removal of the word "an" and the addition of the word "thanks" is not an update to the information - it is deliberate bumping, and nothing more.

As it happens, I didn't down vote you - I would normally prefix my comment with "reason for my vote of one" when I do. And my downvotes have a heavy weighting, causing a large loss of rep points - so I don't down vote often anyway...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900