Results 1 to 5 of 5

Thread: [2005] Insert Row using SqlDataSource

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    40

    Question [2005] Insert Row using SqlDataSource

    Hi, please help

    I am trying to populate a table in a SQL Sever DB, but I am having trouble assigning the InsertParameters. I am using normal textboxes and a SqlDataSource.

    Thanks

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Insert Row using SqlDataSource

    Show some code that you're using to attempt insertion. Why aren't you using stored procedures? Are you really from Africa?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2005] Insert Row using SqlDataSource

    You should be executing a stored procedure instead of unprepared sql statements. The sp can be written to accept parameters.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: [2005] Insert Row using SqlDataSource

    Thanks, I can see that a SP will be the better option, I am coming from a VB6 environment and are realy not used to the asp \ web way of doing things.

    Like how does data binding work if you are not using a data control and want to populate just normal text boxes...

    and Mendhak yes I am from South-Africa.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Insert Row using SqlDataSource

    There are many ways to do it, you could even bind a textbox to a dataset, but common practice is that you retrieve the value into a dataset and directly assign the value...

    Textbox1.text = ds.tables[0].Rows[4].Columns["suppliername"].ToString();



    Seth Africa? That's not really Africa. That's Europe :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width