Jump to content
Xtreme .Net Talk

gicio

Avatar/Signature
  • Posts

    103
  • Joined

  • Last visited

Everything posted by gicio

  1. thanks!! another question: Is it possible to select all data from DB with one statement and fill the DataSet? gicio
  2. "Failed to enable constraints. One or more rows contain values violating non-null, un "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." string Hi! I get this error when I excetute this code (error on line: m_dataAdapter.Fill(m_dsCarTrade,"CustomerAddress");) also I get one error in one Row: <error: an exception of type: {System.Data.StrongTypingException} occurred> (Tables have a relationship to eachother) private OleDbDataAdapter m_dataAdapter; private OleDbConnection m_accessConnection; private OleDbCommand m_accessCommand; private const string m_conStrAccessConnection = "provider=Microsoft.JET.OLEDB.4.0; " + "data source = C:\\Visual Studio Projects\\" + "CarTrade\\CarTradeDB.mdb"; private const string m_conStrSelectCommandCustomer = "SELECT Customer.*, CustomerAddress.* FROM Customer INNER JOIN CustomerAddress ON Customer.CustomerID = CustomerAddress.CustomerID"; private void LoadFreshCustomersFromDB() { //we create an access object m_accessConnection = new OleDbConnection(m_conStrAccessConnection); m_accessCommand = new OleDbCommand(m_conStrSelectCommandCustomer, m_accessConnection); m_dataAdapter = new OleDbDataAdapter(m_accessCommand); //we open the connection to DB m_accessConnection.Open(); try { m_dataAdapter.Fill(m_dsCarTrade,"CustomerAddress"); m_dataAdapter.Fill(m_dsCarTrade,"Customer"); } catch (Exception e) { MessageBox.Show("Sorry....but we have some problems with database. " + "Error message from database : " + e.Message,"ERROR!!!"); } finally { //we close the connection to DB m_accessConnection.Close(); } m_dtCustomers = m_dsCarTrade.Tables["Customer"]; } Know someone why this error caused?
  3. Hi! I will write an application that work with an Access DB. My database have 5 table that have a relationship to each other. tables in DB: Table 1: Car: CarID, Manufactore, Colour, Hp, Displacement, Price, Model Table 2: SaleContractCar: SaleContractID, CarID Table 3: SaleContract: SaleContractID, CustomerID, Date Table 4: Customer: CustomerID, CustomerAddressID, Tel, Age, SeconCar, Name Table 5: CustomerAddress: CustomerAddressID, Street, StreetNr, Zip, City relationship between the tables: Table 1 (one to more) Table 2 Table 2 (more to one) Table 3 Table 3 (more to one) Table 4 Table 4 (more to one) Table 5 at this moment I don't know how to start. should I first load all tables I one DataSet? and create for each table a DataTable? how I should start? how I should write an update SQL statement for this DataSet? where I can find some sample application that work with Relational Data? thx!!
  4. looking for something like a code guidline.... i.e. that a TextBox should have the prefix: txt TextBox --> txt i.e. txtCustomer Label --> lbl i.e. lblCustomer String --> str i.e. strCustomer bool --> boo i.e. booIsValide is something like that anywhere available? gicio
  5. Hi, I write a new class... like this: using System; using System.Windows.Forms; using System.Windows.Forms.ComponentModel; namespace CarTrade { /// <summary> /// Summary description for TestTextBox. /// </summary> public class TestTextBox : System.Windows.Forms.TextBox { private bool booOnlyNumericCharsAllowed; private bool booSpecialKeyIsPress; public TestTextBox. { } //--------------------------------------------------------------- //---------------------------PROPERTIES-------------------------- //--------------------------------------------------------------- //we allowed in the TestTextBox only numeric chars //when the user set the proparty OnlyOnlyNumericCharsAllowed //to true internal bool OnlyNumericCharsAllowed { get { //return the value how OnlyOnlyNumericCharsAllowed //is set return booOnlyNumericCharsAllowed; } set { if(value) { this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.DoWhenKeyPress); } booOnlyNumericCharsAllowed = value; } } internal bool SpecialKeyIsPress { get { return booSpecialKeyIsPress; } set { if(value) { this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckIfSpecialKeysArePressed); } booSpecialKeyIsPress = value; } } private void CheckIfSpecialKeysArePressed(object sender, System.Windows.Forms.KeyEventArgs e) { bool booEnter = e.KeyCode == Keys.Enter; bool booReturn = e.KeyCode==Keys.Return; bool booTab = e.KeyCode==Keys.Tab; if(booEnter || booReturn || booTab) { } } private void DoWhenKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 ) { e.Handled = true; } if(Text.Length == 0 && e.KeyChar == 48) { e.Handled = true; } } } } Any coments are welcome! gicio
  6. thanks! gicio
  7. Hi, I'm looking for developer videos/demos/webcasts tutorials for c#, VB.NET, VB, C++, JAVA, UML, Rational rose, XML, XSLT, SQL and other development stuff. I know right now only the microsoft webcasts and the stuff from http://www.learnvisualstudio.net do you know others? gicio
  8. Hi, do you know other developer boards? special C# and VB and C++ gicio
  9. Hi, I develop an application that have 20 windows forms with many TextBoxes. All TextBoxes have the same validation... I write in all classes the same validation like that: //if the user press a key down at txtDisplacement we check which one was pressed down #region KeyDownInTxtDisplacement code private void KeyDownInTxtDisplacement(object sender, System.Windows.Forms.KeyEventArgs e) { CheckWhichKeyDown(e); } #endregion //if the user press a key down at txtModel we check which one was pressed down #region KeyDownInTxtModel code private void KeyDownInTxtModel(object sender, System.Windows.Forms.KeyEventArgs e) { CheckWhichKeyDown(e); } #endregion //we check which key is pressed //if key Enter or Return or Tab is pressed //we go throw DoWhenOneTextBoxIsMarkedRed() #region CheckWhichKeyDown code private void CheckWhichKeyDown(System.Windows.Forms.KeyEventArgs e) { if(e.KeyCode==Keys.Enter || e.KeyCode==Keys.Return || e.KeyCode==Keys.Tab) { ValidateThis(); } } #endregion //when special key is press we enable the button #region ValidateThis code private void ValidateThis() { cmdAddToDataBase.Enabled = true; } #endregion CheckWhichKeyDown and ValidateThis should be in one validation class. How I can write a validation class that validate ALL TextBoxes from all classes. Any ideas? Or do you know some sample validation classes available on www? gicio
  10. Looking for good Visual Studio .NET books Hi, Know anyone some good Visual Studio .NET books? that describe all VS.NET features... and also hidden features ;) gicio
  11. HI! Is there an free FTP class library for .NET available? OR a open source project that write a FTP class? gicio
  12. Hi! I'm looking for some samples how to write an IRC client in C#. Have someone any samples? thx!
  13. thanks for the info!! gicio
  14. Hi! I check the MSDN Library but I can't find any infos about: how to connect to and FTP... I need also infos how get folders names from the ftp.... Have any one experience which class can I use to connect to an FTP?? THX!!!
×
×
  • Create New...