Create a sql table
Create a sql table
hercules
Posts: 21Questions: 9Answers: 0
What code would I use to create an SQL table that would interface with the code generated by the datable editor code generator. I think it created code to crate a Mysql table.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The Editor generator page offers "SQL server" database type.
https://editor.datatables.net/generator/index
Yes, but it doesn't work. The create Table code does not work
Did you configure the DB connection info?
Do you get an error when the table creation fails?
Have you tried copying the generated table creation code into the SQL query tool of the application you use to manage MySql?
Kevin
I don't have an application to manage MySql. I just read somewhere that that error is caused by the generator code for MySQL. Yes I did enter my database type (sqlserver) and connection string in the settings.settings file. Everything works except for that piece of code that creates the table if it doesn't exist. Is this web api used in a production environment or primarily just for testing? Because for a beginner it structures my solution in a way that for me makes it hard to edit anything. I am watching a youtube video that will give me the same functionality without creating a structure that I am not familiar with. Why does it not create the begin form code? Also it doesn't automatically create the dropdownlist with the number of records you want to show. And I want my edit and delete as buttons inline and it doesn't seem straightforward how to do. Thanks for your help.
I've just tried Generator with the configuration shown in the attached screenshot. It creates SQL Server code:
Perhaps you can show me how you have configured Generator so I can attempt to recreate the issue?
If the program structure that Generator makes doesn't suit your needs, don't use it. Generator is only designed as a quick start tool for those who aren't familiar with .NET or Javascript.
What begin form code? Generator creates the Javascript needed for the Editor form.
See the Q. How can I show the page length select when using Buttons?.
Like in this example? Generator isn't design to give you all of these options. To get the most out of the software, like any software library, you have to use its API and options. Generator is a quick start tool only.
Allan