Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: purplehaze1
  • Content: Threads
  • Order by date
  1. purplehaze1

    how to handle null values in SQL query

    how to handle null values while doing insert/update? here's my problem, the following SQL fails: INSERT INTO t_customer (cust_cde, cust_name, m_ind, start_dte, lst_upd_id) VALUES (,'Tata Young','','2/4/2005','sResh12') db design: cust_cde is smallint type in db that allows null. cust_ind...
  2. purplehaze1

    help needed with SQL

    Is it required to have quotes around field values while doing insert/update/delete? e.g. INSERT INTO t_customer (cust_cde, cust_name, m_ind, start_dte, lst_upd_id) VALUES ('452','Tata Young','S','2/4/2005','sResh12') I receive following err msg if there's no quotes around field values (in this...
  3. purplehaze1

    how to re-write this update code

    I can't get commandbuilder to generate insert/update/delete command in Sybase, so I want to write my own update logic. But I want to avoid writing update/insert/delete routine for each table. I've got about 40 tables. Is there a way for doing this? Thanx. Public function SaveCustomer() as...
  4. purplehaze1

    getting error: Incorrect syntax near the keyword 'DEFAULT'

    I am trying to update a record in customer table located in sybase database. I use commandbuilder. I get following error msg. How can I fix it? It works in SQL Server. Thanx. ERROR [HY00] [INTERSOLV][ODBC SQL Server driver][SQL Server] Incorrect syntax near the keyword 'DEFAULT'. commandText...
  5. purplehaze1

    Getting err: Incorrect syntax near the keyword 'DEFAULT'

    I am trying to update a record in customer table located in sybase database. I use commandbuilder. I get following error msg. How can I fix it? It works in SQL Server. Thanx. ERROR [HY00] [INTERSOLV][ODBC SQL Server driver][SQL Server] Incorrect syntax near the keyword 'DEFAULT'. commandText...
  6. purplehaze1

    how to re-write this code

    A customer can have multiple insurances. So in user interface, I have 4 checkboxes representing multiple insurance types. If any box is checked, first I see if the checked insurance type already exists in the collection before I create a new one. The following code works but is rather long when...
  7. purplehaze1

    urgent: how to cascade foreign key to child tables

    I need to know how to cascade identity key from parent table down to child tables. I have been doing it one way but almost all articles I've read suggest using datarelation to cascade identity key. However, in my code, I save one table a time (see below) and I am confused about how to create...
  8. purplehaze1

    need help cascading identity key to child tables

    I need to know how to cascade identity key from parent table down to child tables. I have been doing one way but most articles I've read suggest using datarelation to cascade identity key. However, in my code, I save one table a time (see below) and so I am confused about how to create relation...
  9. purplehaze1

    urgent help needed with transactions

    I am using dataAdapter to update records (add/delete/update). I want to use transactions with dataAdapter to do updates. I am not sure how I can do it using dataAdapter. I have following coded, is it going to work to insert/delete/update records to the database? Public Function...
  10. purplehaze1

    ques abt collection and datagrid tablestyle

    I am binding the collection to a Datagrid. I can bind to the collection successfully. I am using a tablestyle to limit the data the datagrid displays. However, the tablestyle don't work. How can I make tablestyle to work for collections? another ques, what's the mapping name to be given for...
  11. purplehaze1

    formatting datagrid with data from collection

    I am binding datagrid to collection (orequests) to display customer requests. How do you format datagrid which has collection as datasource? what mapping name to use? i.e. oRequests.GetType.Name did not work. Currently, even though I want only selected fields contaied in collection objects to...
  12. purplehaze1

    ques abt collection

    Suppose I have two tables: customers and orders. I created two class, customer and orders. tbl customer ----------- custid custname tbl orders ---------- orderid custid orderName orderAmt I want to display customer orders in datagrid. So, I created orders collection and binded...
  13. purplehaze1

    ques abt property from VB to vb.net

    How to write this in vb.net? Thanks. Public Property Get Item(vntIndexKey As Variant) As customer On Error Resume Next Set Item = mcol(vntIndexKey) If Err.Number <> 0 Then Set Item = Nothing End If End Property
  14. purplehaze1

    ques about string.empty

    How do you write the same for integer variable (eg. m_itemid)? i.e. if m_itemID is not filled by user, while saving the record, I want to leave it blank on database table. Thankyou. Dim dr as dararow dr("item_desc") = IIf(m_itemDesc = String.Empty, string.empty, m_itemDesc)...
  15. purplehaze1

    simple ques abt property and data type

    In SQL Server database, Social Security field is defined as integer which is not a required field and may have null value. So, in my program, I have public property SocialSecurity that returns integer. My problem is, if the user doesn't enter ss number, then I get an error. How can I solve...
  16. purplehaze1

    getting identity key after update

    I looked into many examples, I can't retrieve identity key after inserting a record. The identity value is returned as dbnull. Please help how I can get identity key. Here's my code below. Thanks. Public Function SaveGuardian() As Boolean Dim strSQL As String strSQL = "SELECT *...
  17. purplehaze1

    how to update a dataset

    I did following for update, It used to work before, it's not working again. what could be wrong with it? Many Thanks. Public Sub SaveAddress() Dim cn As New OleDbConnection(Login.SQL_ConnectionString) Dim da As New OleDbDataAdapter("SELECT * FROM t_recip_address WHERE...
  18. purplehaze1

    update, insert, delete using dataset

    I did following to insert, update, delete address record, it's working. Is there anything that I should be aware of before I implement into my project? Thanks. Public Sub SaveAddress() Dim cn As New OleDbConnection(Login.SQL_ConnectionString) Dim da As New...
  19. purplehaze1

    need help with SQL

    How can I write the following code in vb.Net? Thanks. Set adoRs = New ADODB.Recordset strSQL = "Select * FROM Employees a WHERE a.EmployeeID=" & m_OldEmployeeID & "" adoRs.Open strSQL, Conn, adOpenKeyset, adLockOptimistic With adoRs If Not .EOF Then If m_IsDeleted Then...
  20. purplehaze1

    question abt collection

    if a Customer has multiple address (temp, permanent) and multiple phone and email address, should I make collection for address, phone and email so I can later save to database? How else can I handle such situation? Thanks. The following works, is there better way to handle this? Private...

Part and Inventory Search

Back
Top