Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Insert into mutiple sql tables
Last Post 12-16-2009 06:53 AM by Michael Man. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Michael ManUser is Offline
river guide
river guide
Posts:152
Avatar

--
12-15-2009 12:26 PM

    I have a form that has 4 single text input fields

    InputA, InputB, InputC, InputD

    When user click on submit, I want to use dynamic SQL statement to insert these 4 input into 4 different tables. So inputA will go to tableA, InputB goes to TableB, InputC goes to TableC ,etc.

    However, I want to check if any input field is empty (null) then skip that table and move on the next input

    Can someone give me an idea how to do this?

    Thanks

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    12-16-2009 06:31 AM
    Calling a stored procedure to pass in all the parameters would be a better way to go. In your completion event:

    usp_insert '$(InputA)','$(InputB)','$(InputC)','$(InputD)'

    where the input parameters represent your shortname on your DF page.
    Your stored procedure, which you execute under Host / SQL or SQL Management Studio, would be something like:

    create procedure usp_insert (@InputA nvarchar(200),@InputB nvarchar(200),@InputC nvarchar(200),@InputD nvarchar(200))
    as
    begin
    if @InputA != '' insert into TableA(columnname) values(@InputA)
    if @InputB != '' insert into TableB(columnname) values(@InputB)
    if @InputC != '' insert into TableC(columnname) values(@InputC)
    if @InputD != '' insert into tableD(columnname) values(@InputD)
    end

    -- David
    Michael ManUser is Offline
    river guide
    river guide
    Posts:152
    Avatar

    --
    12-16-2009 06:53 AM
    Posted By David To on 12/16/2009 8:31 AM
    Calling a stored procedure to pass in all the parameters would be a better way to go. In your completion event:

    usp_insert '$(InputA)','$(InputB)','$(InputC)','$(InputD)'

    where the input parameters represent your shortname on your DF page.
    Your stored procedure, which you execute under Host / SQL or SQL Management Studio, would be something like:

    create procedure usp_insert (@InputA nvarchar(200),@InputB nvarchar(200),@InputC nvarchar(200),@InputD nvarchar(200))
    as
    begin
    if @InputA != '' insert into TableA(columnname) values(@InputA)
    if @InputB != '' insert into TableB(columnname) values(@InputB)
    if @InputC != '' insert into TableC(columnname) values(@InputC)
    if @InputD != '' insert into tableD(columnname) values(@InputD)
    end

    -- David


    Thanks for your help. I will try it and let you know
     

    Thanks again

    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi