Didnt seem to have an effect when changed
pestman
Posts
-
Could use some help please. -
Could use some help please.Ok ill start by saying I am new to c# what i am trying to do is basicly access a ultralite db it has a table named Names(name,chan,freq,mpchan) I want to populate a combox with name field than have 3 text fields populate with the appropriate data for the name selection. Here is what i got so far
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Text; using System.Windows.Forms; using iAnywhere.Data.UltraLite; using System.Collections; namespace ChannMap { public partial class Form1 : Form { private string strChan; private string strFreq; private string strName; private string strMapChan; private string strTemp; private string [] strArraylist=new string [1000]; static int i = 0; //index for strArraylist private ULConnection ConnUL = new ULConnection(); private ULDataAdapter myDataAdapter = new ULDataAdapter(); private void Form1_Load(object sender, System.EventArgs e) { fnGetConnectedToDatabase(); } public Form1() { InitializeComponent(); } private void fnGetConnectedToDatabase() { try { String dbf = "\\Program Files\\ChannMap\\ChannMap.udb"; if (System.IO.File.Exists(dbf)) { ConnUL.ConnectionString = "dbf=" + dbf + ";cache_size=1M"; if (ConnUL.State != ConnectionState.Open) { ConnUL.Open(); } ConnUL.DatabaseID = 1000; } else { MessageBox.Show("Database is not available", "Error"); Application.Exit(); } } catch (System.Exception t) { MessageBox.Show(t.Message, "Connection failed"); return; } string sqlStr = "SELECT * FROM Names;"; myDataAdapter = new ULDataAdapter(sqlStr,ConnUL); //Instantiate a DataSet DataSet myDataset = new DataSet(); // Populate the data table "Names" myDataset.Clear(); myDataAdapter.Fill(myDataset,"Names"); foreach (DataRow myRow in myDataset.Tables["Names"].Rows) { strChan =(string) myRow["chan"];
-
Ultralite and c#Hello I have been trying to learn c# and accessing ultralite I have found the link here 10 Steps to Creating a Windows Mobile Database Application Using .NET and UltraLite 10[^] Which has helped i got it working but what im trying to figure out is how to add a listbox that is controlled by the combobox. What would happen is I select say tom than the list box displays the address.I cant seem to get anywhere with it my previous coding experience is with html and vbscript. Any help would be appreciated or if you can point me in the right direction Thank You Aaron