Hi Guffa, I get the following error message: ERROR [HY104][Microsoft][Microsoft Access ODBC Driver]Invalid precision value Thanks for your reply. Bye for now. JC.
JC Carmo
Posts
-
C# VS 2005 - SQL Query Parameters to an ODBC DataSource -
C# VS 2005 - SQL Query Parameters to an ODBC DataSourceHello everyone, I used to have my MS Access 2002 DataBase placed in my application folder and connect to it through an OLEDB connection. Everything worked fine. Now I decided to create an ODBC DataSource and suddenly I'm not able to pass parameters to the SQL Query the way I used to with the OLEDB connection. Here's a sample code of the SQL Query and C# code on my form: FillByClienteDataNumero query: SELECT Data, Cliente, Tipo, Número, Espécie, Lote, Análise, Preço FROM qryALL1 WHERE (Cliente = ?) AND (Data >= ?) AND (Data <= ?) AND (Tipo = ?) ORDER BY Data, Número Form code: private void btnSeekBA_Click(object sender, EventArgs e) { try { this.qryALL1TableAdapter.FillByClienteDataTipo(this.sascrDataSet.qryALL1, cbCliente.Text, new System.Nullable(((System.DateTime)(System.Convert.ChangeType(DataIni.Text, typeof(System.DateTime))))), new System.Nullable(((System.DateTime)(System.Convert.ChangeType(DataFin.Text, typeof(System.DateTime))))), "Boletim"); } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } Any ideas why the above SQL query and code work with an OLEDB connection but not with an ODBC DataSource? Thanks a million! JC.
-
C# VS2005 - Installing deployed application to an specific pathHello everyone, Where exactly do I configure a C# application to install in a specific path? Like, for example: C:\Program Files\myApp Please note that I don't mean the deployment folder! I looked throughout the application properties, publish properties and publish Wizard, but didn't find a configuration option for that. Thanks a lot, JC.
-
C# VS 2005 - Crystal reports questionHello to all, When I'm running my application from the debug folder, I'm able to save changes to the database, but when I load the Crystal report to display that data, it still displays the old data, i.e., the data before the changes. Does it have anything to do with the database Build Action property and Copy property or it has something to do with the report source path? Thanks a lot, JC.
-
C# VS2005 - Problem publishing applicationProblem solved! It was pathetically simple... All I had to do was to set the reports file property "Build Action" to "Content". Now everything is ok. Thanks a lot! JC
-
C# VS2005 - Problem publishing applicationHello everyone, After I publish my C# VS2005 application (to be installed from CD-ROM), the crystal reports in it will not load, but if I run the application from debug, everything works fine. Does anybody know what's going on? Thanks a lot. Best regards, JC
-
C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help!Hi Christian, It's me again. I don't mean to be a drag, sorry about it, but I know how to connect to a dataSet in events such as form-load, but in this particular case, I'm a little lost, since the code I posted is part of teh code that filter values in comboboxes in a datagridview. Thanks a lot. JC. :)
-
C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help!I mean the tabSementes table that is referenced in the code. How do I connect it to a DataSet ? Thanks for your reply. JC.
-
C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help!Hello everyone, Greetings from Brazil! As shown in the code below, is it possible for me to add the new objects for tipoDT and sementesDT without having to do it one-by-one? Like, for example, getting the values automatically from the tables?.... How would I do that? The sementesDT table is quite large and would take me forever to add the new objects one-by-one! Here's the code: public frmBA() { tipoDT = new DataTable("tabTipoSemente"); tipoDT.Columns.Add("CodTipo", typeof(int)); tipoDT.Columns.Add("Tipo", typeof(string)); tipoDT.Rows.Add(new object[] { 0, "Nocivas Probidas" }); tipoDT.Rows.Add(new object[] { 1, "Nocivas Toleradas" }); tipoDT.Rows.Add(new object[] { 2, "Sementes Silvestres" }); sementesDT = new DataTable("tabSementes"); sementesDT.Columns.Add("CodSemente", typeof(int)); sementesDT.Columns.Add("CodTipo", typeof(int)); sementesDT.Columns.Add("Semente", typeof(string)); sementesDT.Rows.Add(new object[] { 0, 0, "SubCat0-Cat0" }); sementesDT.Rows.Add(new object[] { 1, 0, "SubCat1-Cat0" }); sementesDT.Rows.Add(new object[] { 2, 0, "SubCat2-Cat0" }); sementesDT.Rows.Add(new object[] { 3, 1, "SubCat3-Cat1" }); sementesDT.Rows.Add(new object[] { 4, 1, "SubCat4-Cat1" }); sementesDT.Rows.Add(new object[] { 5, 1, "SubCat5-Cat1" }); sementesDT.Rows.Add(new object[] { 6, 2, "SubCat6-Cat2" }); sementesDT.Rows.Add(new object[] { 7, 2, "SubCat7-Cat2" }); sementesDT.Rows.Add(new object[] { 8, 2, "SubCat8-Cat2" }); InitializeComponent(); tipoBS = new BindingSource(); tipoBS.DataSource = tipoDT; TipoComboBoxColumn.DataSource = tipoBS; TipoComboBoxColumn.DisplayMember = "Tipo"; TipoComboBoxColumn.ValueMember = "CodTipo"; unfilteredSementesBS = new BindingSource(); DataView undv = new DataView(sementesDT); unfilteredSementesBS.DataSource = undv; EspecieComboBoxColumn.DataSource = unfilteredSementesBS; EspecieComboBoxColumn.DisplayMember = "Semente"; EspecieComboBoxColumn.ValueMember = "CodTipo"; filteredSementesBS = new BindingSource(); DataView dv = new DataView(sementesDT); filteredSementesBS.DataSource = dv; } Thank you very muc
-
C# 2005 - DataGridView and ComboBoxes questionsHello everyone, Greetings from Brazil! Please help! I have a DataGridView in a windows form with three columns: Column1 is TipoComboBoxColumn Column2 is QuantidadeColumn Column3 is SementeComboBoxColumn I need the SementeComboBoxColumn to display values according to the value I select in the TipoComboBoxColumn. How do I go about accomplishing that? The code below works in part, BUT when I'm editing the value of SementeComboBoxColumn, the other values in this column disappearin the other rows. private void tabBAdetDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (tabBAdetDataGridView.Columns[e.ColumnIndex].Name == "EspecieComboBoxColumn") { this.tabSementesTableAdapter.FillByTipo(this.sascrDataSet.tabSementes, tabBAdetDataGridView.Rows[e.RowIndex].Cells["TipoComboBoxColumn"].Value.ToString()); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } else { this.tabSementesTableAdapter.Fill(this.sascrDataSet.tabSementes); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } } Thanks in advance, JC Carmo
-
C# 2005 - Datagrid and comboBoxes, How do I ... ?Hello everyone, I have a DataGridView in a windows form with three columns: Column1 is TipoComboBoxColumn Column2 is QuantidadeColumn Column3 is SementeComboBoxColumn I need the SementeComboBoxColumn to display values according to the value I select in the TipoComboBoxColumn. How do I go about accomplishing that? The code below works in part, BUT when I'm editing the value of SementeComboBoxColumn, the other values for the other rows in this column disappear. This is driving nuts! private void tabBAdetDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { if (tabBAdetDataGridView.Columns[e.ColumnIndex].Name == "EspecieComboBoxColumn") { this.tabSementesTableAdapter.FillByTipo(this.sascrDataSet.tabSementes, tabBAdetDataGridView.Rows[e.RowIndex].Cells["TipoComboBoxColumn"].Value.ToString()); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } else { this.tabSementesTableAdapter.Fill(this.sascrDataSet.tabSementes); this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource; this.EspecieComboBoxColumn.DisplayMember = "Semente"; } } Thanks in advance, JC Carmo
-
C# 2005 - childForm setting MDIParent of another childFormHello everyone, Here's the scenario: I have three windows forms (frmMain, frmClients, frmOrders). There's a button on frmClients that opens frmOrders. Now, the question is: What's the code on frmClients to define that the frmOrders' MDIParent is frmMain? Thank you very much for your time and help, JC Carmo.
-
[Message Deleted][Message Deleted]