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 strongm 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
  • 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

    ...Public function SaveCustomer() as boolean Dim strsql As String Dim myCommand As OdbcCommand Dim dr As DataRow Try strsql = "SELECT * FROM t_customer WHERE cust_id=" & m_custID myCommand = New OdbcCommand(strsql, myConnection) Dim da As New OdbcDataAdapter(myCommand) Dim...
  4. purplehaze1

    getting error: Incorrect syntax near the keyword 'DEFAULT'

    Since above commandbuilder update (insert/delete/update) won't work in my Sybase db, how can u write your own update logic? Thanx.
  5. purplehaze1

    getting error: Incorrect syntax near the keyword 'DEFAULT'

    ...Dim strsql As String Dim myCommand As OdbcCommand Dim dr As DataRow, i As Integer Try strsql = "SELECT * FROM t_customer WHERE cust_id=" & m_custID myCommand = New OdbcCommand(strsql, myConnection) Dim da As New...
  6. purplehaze1

    Getting err: Incorrect syntax near the keyword 'DEFAULT'

    ...Dim strsql As String Dim myCommand As OdbcCommand Dim dr As DataRow, i As Integer Try strsql = "SELECT * FROM t_customer WHERE cust_id=" & m_custID myCommand = New OdbcCommand(strsql, myConnection) Dim da As New...
  7. purplehaze1

    how to re-write this code

    ...Dim dr As DataRow Dim oInsuranceType As InsuranceType Dim InsuranceTypes As New InsuranceTypes() strSQL = "SELECT * from t_insurance_type" Dim da As New OleDbDataAdapter(strSQL, myConnection) Dim ds As New DataSet() da.Fill(ds, "InsuranceType")...
  8. purplehaze1

    how to re-write this code

    ...dr As DataRow Dim oInsuranceType As InsuranceType Dim InsuranceTypes As New InsuranceTypes() strSQL = "SELECT * from t_insurance_type" Dim da As New OleDbDataAdapter(strSQL, myConnection) Dim ds As New DataSet()...
  9. purplehaze1

    how to re-write this code

    Thanks korach and stevexff for your valuable comments. listcheckbox is good idea, didn't realize. :) Like steve said, I have insurance types in the database. And insurance class has enum type insurancetypes with the same value as in the database. Following korach's eg in the form load event...
  10. 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...
  11. purplehaze1

    urgent: how to cascade foreign key to child tables

    ...trans = myConnection.BeginTransaction(IsolationLevel.RepeatableRead) bolInTran = True End If strsql = "SELECT * FROM t_customer WHERE cust_id=" & m_custID myCommand = New OleDbCommand(strsql, myConnection, trans) Dim da As New OleDbDataAdapter(myCommand) Dim cb As...
  12. purplehaze1

    need help cascading identity key to child tables

    ...trans = myConnection.BeginTransaction(IsolationLevel.RepeatableRead) bolInTran = True End If strsql = "SELECT * FROM t_recip WHERE recip_id=" & m_recipientID Dim mycommand As New OleDbCommand(strsql, myConnection, trans) Dim da As New...
  13. purplehaze1

    need help cascading identity key to child tables

    ...trans = myConnection.BeginTransaction(IsolationLevel.RepeatableRead) bolInTran = True End If strsql = "SELECT * FROM t_customer WHERE cust_id=" & m_custID myCommand = New OleDbCommand(strsql, myConnection, trans) Dim da As New OleDbDataAdapter(myCommand)...
  14. purplehaze1

    urgent help needed with transactions

    Beck, I cannot instantiate oledbtransaction because it shows error when I try to. I guess the reason it's bombing is because in da.UpdateCommand.Transaction = Trans da.InsertCommand.Transaction = Trans da.DeleteCommand.Transaction = Trans da.updatecommand, da.insertcommand and...
  15. purplehaze1

    urgent help needed with transactions

    when I mouse over da.UpdateCommand, it shows nothing. What could be the reason? Thanks
  16. purplehaze1

    urgent help needed with transactions

    It blows up at line da.UpdateCommand.Transaction = Trans Error msg is "object reference not set to an instance.."
  17. purplehaze1

    urgent help needed with transactions

    ...= True) As Boolean Dim strsql As String Dim myCommand As OleDbCommand Dim dr As DataRow, bolInTran As Boolean strsql = "SELECT * FROM t_recip WHERE recip_id=" & m_recipientID myCommand = New OleDbCommand(strsql, myConnection) Dim da As New...
  18. 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...
  19. 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...
  20. 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...

Part and Inventory Search

Back
Top