mysql - How to Insert a query into two diff table vb.net -


I'm having trouble entering an item from two different tables using vb.net and MySql

This is the item table and the stock table in a single query:

  New ADODB. Rikesset rsitem.CursorLocation = ADODB.CursorLocationEnum.adUseClient rsitem.CursorType = Insert as ADODB.CursorTypeEnum.adOpenDynamic rsitem.Open in rsitem ( "items, not stock items = '" & amp; txtItemNo.Text and amp ;;' ', Description =' & amp; txtDescription.Text & amp;; '', value = '' & txtPrice.Text & amp; "', brand =' '& amp; txtBrand.Text & amp;; stock_on_hand = '' & TxtStocks.text & amp; "'", cn)   

My problem occurs when I type in the input box TxtStocks.text mysql from my vb.net Whatever input does not show in DB, I think I have a wrong query. Can someone help me.

  1. First you need to make sure the text boxes are not empty
  2. Then its related to rsitem.Open , I saw you opening it twice
  3. Third, your query is wrong! Do you want to include in your table? I think items ?

    You can try the following;

      If not (String.IsNullOrEmpty (txtItemNo.Text) Orelse String.IsNullOrEmpty (txtDescription.Text) Orelse _ String.IsNullOrEmpty (txtPrice.Text) Orelse String.IsNullOrEmpty (txtBrand.Text) Orelse_String .IsNullOrEmpty (txtStocks.Text) then rsitem.CursorLocation = ADODB.CursorLocationEnum.adUseClient rsitem cursor type = ADODB.CursorTypeEnum.adOpenDynamic rsitem.Open (String.format) (item (item, description, price, brand, Stok_on_hand) values ​​( ' {0} ',' {1} ',' {2} Insert ',' {3} ',' {4} ') ", _ txtItemNo.Text, txtDescription.Text, txtPrice.Text, txtBrand.Text, TxtStocks.text), connection if end    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -