Hi Guys, If you have a Text Box which you are putting in the Decimal Places such as "15.50". Then Submitting this to a Access Database then on re-fresh the data shows in the grid view as "15.5". Where abouts should this be modified so that it shows Decimal Places? Is it on the Access DB Layout and how it's store or should there be come amendment on the code side? It looks like the GridView is removing the trailing '.00's' ?? Many thanks for any help.

Member Avatar
Member Avatar
+0 forum 11

Hi Guys, I hope you can help me out... I have a slight issue in where the 'Search Box' Code I currently have seems to sift through the Populated Data Grid View fine. However, when selecting an Account that has been filtered by the use off the 'Search Box' it correctly populates the TextBoxes but when clearing the 'Search Box' it then removes the data in the Grid view below which I don't want. My question is, How do I stop this from happening? I want to keep the DGV Populated to re-use again. I have attached screenshots of the …

Member Avatar
Member Avatar
+0 forum 6

Hi Guys, Hope you can help. (Bit of a N00b still).. I've written an Functioning Program (Good start!) However, I was wondering if there is a way for the data that is being shown currently in the Grid view to be shown with 'Decimal Places? The Data is Being pulled in via ODBC from a Access DB. The Table Column has been setup as 'DataType' = Currency with Decimal Places Defaulted to '1'. When looking at the data in the DB the Decimal Places are in the correct place but when pulling the data via ODBC into the GridView it …

Member Avatar
Member Avatar
+0 forum 5

Hi Guys... looking for a quick answer on excel Formula.. Anyone know why my text "Please Chase" is not showing up? =IF(ISNUMBER(F2),$F2>TODAY(),"Please Chase")

Member Avatar
Member Avatar
+0 forum 3

Hi Guys, is there a Code snippet which allows me to check if a certian ADO Connection has been setup on a clients Local machine and if not then disable certian Radio buttons? The reason I ask is I have a 'Read-Only' Connection to a DB (Don't ask.. that's all the 3rd Party will give us access to). Some of the local machines will not have the program installed (hence the ADO connection won't exisit) Any adivce would be great. Kind regards Mark.

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, OK, i've been through nearly all the properties possible in VS2010 to try and find how to do this most basic of tasks. Look at Screenshot 25... This is how it shows at the moment. Now look at Screenshot 26... This is How I WANT it too look but every property i try it does not fill to DGV!? Any ideas? Regards Mark.

Member Avatar
Member Avatar
+0 forum 8

Hi Guys, I have a Dataset which has been populated correctly now (after a bit of a blonde moment earlier). I've decided to go for a ComboBox Drop-Down option which currently is showing the "companyname" Column of the DataSet. However, How do I go about Getting Text boxes to To populate with the relevent information from the Company that has been selected in the 'ComboBox' ? (If that makes sense?) For Example: *Company 1* selecting in the ComboBox. Text Boxes below need to populate with that Companies Details. Thanks for your help. Regards Mark.

Member Avatar
Member Avatar
+0 forum 2

Hi Guys... Putting together a Tiny little app which shows VPN Details for use 'In-House' but for some strange reason my DataSet won't fill? Can anyone spot the mistake? :S private void Form1_Load(object sender, EventArgs e) { //XML Load of Document. This loads the XML Document and the value of a Single Node then inputs this to a text box// XmlDocument doc = new XmlDocument(); doc.Load("C:\\vpn.xml"); XmlNode node = doc.SelectSingleNode("/DataBases/VPN_Access/vpn_DB"); this.txtBoxDebug.Text = node.InnerText; //Creates new versions of the Connection string and Data Set// con = new System.Data.OleDb.OleDbConnection(); ds = new DataSet(); //The actual connection to the database// con.ConnectionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0;Data …

Member Avatar
Member Avatar
+0 forum 11

Good morning Guys, I've got this code currently running: private void button1_Click(object sender, EventArgs e) { SqlDataSourceEnumerator sdse = SqlDataSourceEnumerator.Instance; DataTable table = sdse.GetDataSources(); foreach (DataRow row in table.Rows) { instanceCombobox.Items.Add(row["ServerName"].ToString() + "\\" + row["InstanceName"].ToString()); } Which gives me the Instance and Name of the SQL Server over the Network. I'm now looking to Cycle through available databases on the 'Selected' Instance. Ideally the Databases for the 'Selected' Instance in the 'Top Combo Box' would be in a seperate 'ComboBox. I checked the Databale through debug but the information is not held there so cannot call it. Any help would …

Member Avatar
Member Avatar
+0 forum 2

Hi guys... I have a radio button that one checked will connect to an ADO Connection. The following code being used is: private void radioButton3_CheckedChanged(object sender, EventArgs e) { //Fields Disabled until a new Account is created.// txtAccRef.Enabled = false; txtAccName.Enabled = false; txtAccAddr1.Enabled = false; txtAccAddr2.Enabled = false; txtAccTown.Enabled = false; txtAccCounty.Enabled = false; txtAccPostCode.Enabled = false; //Buttons Disabled as not needed// btnNewCashAcc.Enabled = false; btnEditCashAcc.Enabled = false; btnSaveCashAcc.Enabled = false; btnDeleteCashAcc.Enabled = false; //As Data is being pulled from Line 50 this fields have cleared.// txtAccRef.Clear(); txtAccName.Clear(); txtAccAddr1.Clear(); txtAccAddr2.Clear(); txtAccTown.Clear(); txtAccCounty.Clear(); txtAccPostCode.Clear(); //Opens the Line 50 Connection// adoConn.Open("SageLine50v19", …

Member Avatar
Member Avatar
+0 forum 4

Hi Guys.. Can any experts in Excel/C# Help me with this one? I think I'm nearly there. Currently I have a DGV on a windows form which pulls data from a Datasource. I want to export the findings to and Excel report template. I've managed to export the data into Excel (with some help from the web and of course Dani). However, I'm trying to format it so that the data in question is populated into selective cells of my choosing i.e. They fit the template. My 'Export' Code currently looks like this... private void button1_Click(object sender, EventArgs e) { …

Member Avatar
Member Avatar
+0 forum 29

Hi Guys, Is there a best practise when having an ADO connection to speed up the process? Currently the method I am using below works fine but it's a little slow in getting the data. Is there any hints, tips or tricks I can utilise to speed this up? //Opens the Line 50 Connection// adoConn.Open("SageLine50v19", "Manager", "", 0); //Creates new versions of the Connection string and Data Set// da = new OleDbDataAdapter(); ds4 = new DataSet(); if (File.Exists("C:\\twDB.xml")) { //Create a new Datatable called "accountsTable" and then adds that the the DataSet 4// DataTable accountsTable = new DataTable("accounts"); ds4.Tables.Add(accountsTable); //SQL …

Member Avatar
Member Avatar
+0 forum 5

Morning Guys.. Have a Monday Morning Blank out here! I have the following Debug code setup: //XML Load of Document. This loads the XML Document and the value of a Single Node then inputs this to a text box// XmlDocument doc = new XmlDocument(); doc.Load("C:\\twDB.xml"); XmlNode node = doc.SelectSingleNode("/DataBases/DataBase/Connection"); this.textBox1.Text = node.InnerText; Currently shows the path of XML in text box for Debugging. However - How do I show that same information in form2.cs textbox1 ? Minds gone blank.. need more coffee. Regards Mark.

Member Avatar
Member Avatar
+0 forum 5

Hi guys, I'm hoping you can help here with a problem I am having with regards to filling a Dataset. It was working fine but have had to amend the code to read a different data set and structure. Basics are 2 tables.. one customers, 1 orders. Joined on there Account Reference. SQL seems to be working correctly. **See below:** SELECT cashID, cashQTY, cashDescription, cashSupplier, cashDate, cashCost, cashSell, CashAccountRef_FKID from cashOrders INNER JOIN CashCustomers ON cashOrders.CashAccRef_FKID=cashCustomers.CashAccRef WHERE cashCustomers.CashAccRefID = @HOME But I get "No value given for one or more required parameters." DB table layout seems correct. I'm sure Im …

Member Avatar
Member Avatar
+0 forum 9

Hi Guys.. Hoping you can help here.. I'm dabbling with Linq as I'm wanting to pass a Node Value from the XML file into the Connection String. Currently my Code seems to be working and holding the Value in the System.(Code Below:)(Screenshot attached also) XDocument testXML = XDocument.Load("C:\\twDB.xml"); var DataBases = from DataBase in testXML.Descendants("DataBase") select new { Connection = DataBase.Element("Connection").Value.ToString() }; I placed a textbox1 onto my form just to make sure I could pass the value but i'm not able too? Any help on this would be great. Regards Mark.

Member Avatar
Member Avatar
+0 forum 1

Hi guys, I've been cracking on with this project for a few days now and had lots of useful pointers to help along the way. I've now hit a little snag where I think I have written the correct update Statement but It seems to error at the last point. **The Code is the following:** if (radioButton1.Checked == true) { //Creates new versions of the Connection string and Data Set// con = new System.Data.OleDb.OleDbConnection(); ds = new DataSet(); //The actual connection to the database// con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = E:/Orders1.mdb"; //Open the Connection to the Database// con.Open(); //The SQL UPDATE …

Member Avatar
Member Avatar
+0 forum 10

Hi Guys, The reason for my message was to do with UPDATE and DELETE Statements from within C# when contacting a MDB file. I currently have the INSERT INTO SQL Query working perfectly The Code I used for this is below: else if (radioButton2.Checked == true) { //Creates new versions of the Connection string and Data Set// con = new System.Data.OleDb.OleDbConnection(); ds = new DataSet(); //The actual connection to the database// con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = E:/Orders1.mdb"; //Open the Connection to the Database// con.Open(); //The SQL INSERT INTO String you need to pass into the Data Adapter to collect the …

Member Avatar
Member Avatar
+0 forum 7

Hi Guys, Right... I've managed to run select statements with associated Joins to show the data I want in DGV's which is great. Seems to be working fine. I'm not to the point where I need to be able to Insert, Update & Delete Rows in my Database. I am guessing If I can nail down one of these the others shoul fall into place with some tweaking of the code. The Code I've written uses the 'CommandBuilder' object to try and re-establish a connected to the DB. Whilst Debugging the Values seem to be passed correclty (See Screenshot attached) …

Member Avatar
Member Avatar
+0 forum 2

Hi again guys... I have a little but of an issue with a select statement I cannot seem to fathem out. Below is the code: else if (radioButton3.Checked == true) ; { //Looks at the row Selected in the GridView and then takes the Account Number and Stores in a String Value called 'Customer ID'// DataGridViewRow drow = dataGridView1.SelectedRows[0]; String CustomerID = Convert.ToString(drow.Cells[0].Value); //Message to Test ID has been stored// MessageBox.Show("Customer ID Stored"); //Creates new versions of the Connection string and Data Set// con = new System.Data.OleDb.OleDbConnection(); ds3 = new DataSet(); //The actual connection to the database// con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data …

Member Avatar
Member Avatar
+0 forum 3

Hi Guys, Have a random problem as to why my headers are not being shown properly in the form? Possibly a simple anwser but can't see the wood for the tree's at the moment and another pair of eyes is always great. Code below: private void radioButton1_Click(object sender, EventArgs e) { //Creates new versions of the Connection string and Data Set// con = new System.Data.OleDb.OleDbConnection(); ds = new DataSet(); //The actual connection to the database// con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = E:/Orders1.mdb"; //The SQL String you need to pass into the Data Adapter to collect the information// string CashCustomerSQL = "SELECT …

Member Avatar
Member Avatar
+0 forum 6

Hi Guys, I've just picked up an old projcet I was working on (about 6 months ago) and trying to get my head around my own messy N00b code. I've managed to get the grid views working with links back to the tables and showing data in the correct places. However, I have some tables with values in which seem to be passing correctly but don't seem to update on the order tables. on the 'Save' button I am using the following code: private void btnOrderSave_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA); DataRow DRO = cashOrdersDS.Tables["cashOrders"].NewRow(); …

Member Avatar
Member Avatar
+0 forum 5

Hi Guys... I've had some great help from the members in Dani Web so thanks for all the support so far. Now My first ever credible application is working I would like to try and setup some type of Licencing for it. I've come across many tutorials in regards to creating KeyGens (which is greatt..) but now actual way to show how the product then un-encrypts the keygen to make sure its correct! nothing about the algo used. So I'm a little bit stuck and looking for some advice.. Would it be easier to create a keygen or a licence …

Member Avatar
Member Avatar
+0 forum 3

Hi Guys, Currently I have a form that load an XML file and populates Text Boxes with certian Values from that XML. I also have an 'Admin' form which accept new values. What I am wanting to do is the following: When the Admin screen is loaded from a button on the main form, populated with new credentials and then the 'Apply Changes' button is pressed. The main form to 'refresh' or 're-load' the connection to the XML to pick up the new values. **Code for Main for Load:** { public partial class Form1 : Form { private XmlDocument smtpDetails; …

Member Avatar
Member Avatar
+0 forum 16

Hi Guys, I've been working on a little something where details get put into an XML File and then squirted into another form which has been working fine. I've now added another section to the XML file to hold the Company Name and it gets written to the XML without a problem but when trying to populate the text box on another form with the Company Name value from the XML file it does not work! There is no error either which is annoying. **The Code I'm currently using to try and get the variable is:** private void Send_Click(object sender, …

Member Avatar
Member Avatar
+0 forum 39

Hi Guys, I'm quickl writing a little application which sends an email via SMTP and has the option to add a attachment. This is working fine however, When I went to send a email without attaching a file the Error Message I get is the following **"The Parameter 'fileName' cannot be an empty string. Parameter: fileName"** I can understand that the system is expecting there to be a file to link (which does work when wanting to attach a file) but I'm not to sure where to add the conditioning so that the attach method would only be called IF …

Member Avatar
Member Avatar
+0 forum 4

Hi guys, Needing some help here please. I have a 'Save button' setup on my form which seems to be working perfectly. It allows vales to be taken from text boxes and then presented on a datagrid view and also saved to the underlying databse. **The Code for this save button is below:** private void btnSaveAcc_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA); DataRow DR = cashCustomersDS.Tables[0].NewRow(); DR["CashAccRef"] = Int64.Parse(txtBoxAccRef.Text); DR["CashName"] = txtBoxName.Text.ToString(); DR["CashAddress1"] = txtBoxAddr1.Text.ToString(); DR["CashAddress2"] = txtBoxAddr2.Text.ToString(); DR["CashTown"] = txtBoxTown.Text.ToString(); DR["CashAddress3"] = txtBoxCounty.Text.ToString(); DR["CashAddress5"] = txtBoxPostCode.Text.ToString(); cashCustomersDS.Tables[0].Rows.Add(DR); cashDA.Update(cashCustomersDS, "cashCustomers"); MessageBox.Show("Customer Added"); } Now... the issues …

Member Avatar
Member Avatar
+0 forum 50

Hi Guys.. I've found a little tutorial which seems to show exactly what I have been trying to do which seems to work upto a certian extent. The code I am using is the following: **Code:** using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } System.Data.OleDb.OleDbConnection Conn; private void Form1_Load(object sender, EventArgs e) { //Create DataSet Object & New DataSet Conn = new System.Data.OleDb.OleDbConnection(); //The Connection Below is for Access 2010 DataBase Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/DemoDB1.accdb"; …

Member Avatar
Member Avatar
+0 forum 1

Hi Guys - newbie here.. I have been working with OLEDB connection for the past few weeks and now have this connection in ADO and i'm not sure how to proceed. **The Connection information is the following:** private ADODB.Connection adoConn = new ADODB.Connection(); private ADODB.Recordset adoRS = new ADODB.Recordset(); and then... public Form1() { InitializeComponent(); //Opens Line 50 Connection// adoConn.Open("SageLine50v17", "Manager", "", 0); adoRS = adoConn.OpenSchema(ADODB.SchemaEnum.adSchemaTables, null, System.Reflection.Missing.Value); while (!(adoRS.EOF)) { comboBox1.Items.Add(adoRS.Fields["TABLE_NAME"].Value.ToString()); adoRS.MoveNext(); } adoRS.Close(); } now currently this opens the Scheme for the Databse and populates the table names inside a drop-down combox. What I was it to do …

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, I have a form with a DGV and some text boxes.. I am trying to get the program to update the rows shown on the DGV by using the values in the text boxes. Below is my code so far: private void btnOrderEdit_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA); System.Data.DataRow dRow2 = cashOrdersDS.Tables["cashOrders"].Rows[0]; dRow2[1] = Int64.Parse(txtOrderQTY.Text); dRow2[2] = txtBoxDescrip.Text.ToString(); dRow2[3] = txtBoxSupplier.Text.ToString(); dRow2[4] = dateTimePicker1.Value.ToString(); dRow2[5] = Convert.ToDouble(txtBoxCost.Text); dRow2[6] = Convert.ToDouble(txtBoxSell.Text); dRow2[7] = Int64.Parse(textBox1.Text); cashDA.Update(cashOrdersDS, "cashOrders"); MessageBox.Show("Data Updated"); } Any help would be great!

Member Avatar
Member Avatar
+0 forum 8

Hi Guys, **<-- Newbie Here!** I seem to have an issue with an INSERT INTO statement when trying to add some textbox data into a DataSet and then update the backend table called 'cashOrders' in a Access Databse. The Following code is being run from the 'Save Button' private void btnOrderSave_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBuilder cb; cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA); cashOrdersTable.TableName = "cashOrders"; DataRow DRO = cashOrdersDS.Tables["cashOrders"].NewRow(); DRO["QTY"] = Int64.Parse(txtOrderQTY.Text); DRO["Description"] = txtBoxDescrip.Text.ToString(); DRO["Supplier"] = txtBoxSupplier.Text.ToString(); DRO["Date"] = dateTimePicker1.Text.ToString(); DRO["Cost"] = decimal.Parse(txtBoxCost.Text); DRO["Sell"] = decimal.Parse(txtBoxSell.Text); DRO["cashAccountRef_FKID"] = Int64.Parse(textBox1.Text); cashOrdersDS.Tables["cashOrders"].Rows.Add(DRO); cashDA.Update(cashOrdersDS.Tables["cashOrders"]); MessageBox.Show("Added"); } Currently when Debugging and stepping through the …

Member Avatar
Member Avatar
+0 forum 4

The End.