Missing CREATE DATABASE code in PowerDesigner script - sql-server

I've created PDM in PowerDesigner and I want to generate a database of it. When I choose Database -> Generate database option in main menu, pop-up dialog is shown where I need to configure database properties like data source, credentials and other.
When I check another options in dialog window, everything seems OK to me, and Create database section is selected, meaning the Create Database... code will be included in script. When I generate script using Direct generation (General settings) option, result code doesn't consist Create Database... code.
Am I doing something wrong?

I think it is not very good explanation... Especially script related to direct generation... But if you really mean script (as title of your question says) then most likely you need to create database in your model.
To get it open model properties and press New button near database row:
When model created you need to set corresponding checkbox in Options tab during generation of model (create database, drop, open and so on).

Related

MS Access linked table (SQL Backend) - how to create combo box (drop down list)?

I am using MS Access linked to an SQL backend DB. Thus, design mode is unavailable in Access.
For one of the columns I want to be able to have a drop-down (combo-box) functionality where only the users will be able to select a value from the drop-down list.
I was able to do constraint in the SQL table, which restricts the values that can be entered, but this doesn't create the drop-down list in Access.
I searched and found this Is it possible to use a drop down list in a linked table in MS Access but no solution was provided.
thanks
For data entry by users, don't let them use the table directly, build a form instead.
There you can use drop-down boxes and everything else.
If you like the look and feel of datasheets, use the datasheet form wizard for a simple starting point.
You can (and should) build a form. (don't allow users to open a table directly, as then you can't really verify data input, and provide a workable UI to the users.
And you can even create a data sheet form. So, it will look and feel much like a table anyway.
And with dropping a combo box into that form? Then you are free to setup the combo box source that provides the list of choices.
In fact, often I will using a multiple-items form (a continues form), and the reason is that you can put multiple kinds of controls on that form.
this allows you to create forms like this:
So in above, we have buttons, check boxes, combo box etc. So, you have a lot more flexibly.
You never really wanted to allow or have direct use of tables. They are not in general for appcations and contrlling the user interface, but only a handy way for users to edit data. The instant you want control of the layout, and to use things like buttons, combo boxs, check box as above shows?
Then build your custom form for this purpose. As general rule, you really don't want users to edit tables directly - you have no control over what they can do, and this tends to make applications very hard to write, and control the user experience.

binding data to control wpf error

I am trying to learn WPF and how to connect and bind a sql database I have so i can return information etc. I have connected the database, the dataset is within solution explorer, the data sources are there for selection and there is a .edmx file within solution explorer.
I am trying to drag a table across from the data sources to the main window in the mainWindow.xaml page. I am getting this error. Can anyone advise on what I have to do.
"Cannot add the control to the design surface or bind to the control because the type wpftryout.CiaranTestDataSet cannot be resolved. Please try to build the project or add necessary assembly references."
As per my knowledge, There is no direct way to include SQL Database object for Display purpose. What you can do is get information from database in one table and then you can bind your information to specific object As mentioned in below link
http://www.codeproject.com/Tips/362436/Data-binding-in-WPF-DataGrid-control
In case u required more help, Please let me know
I had the same problem. After reading this: http://social.msdn.microsoft.com/Forums/en-US/9fc4f835-d6c0-4d04-86c2-779c1f8e0791/unable-to-drag-data-source-to-control-to-bind I created a new project on my C: drive (rather than the network location VS defaulted to) and it suddenly worked fine!

intellij idea data sources doesn't see existing table in the database

intellij idea data sources doesn't see existing table in my mysql database, while Netbeans see it.
i've created a table in the database. When i create connection in intellij idea data sources, it sees my scheme, i do select it in "schemas and tables" but then i don't see it in the list.
every schema, but mine's. When i try to connect to it with netbeans or mysql workbench, it's just ok. same story with several databases, with root access, too. any table, but mine's.
what could be wrong?
i see question like mine's here, related to visual studio, no answer.
please, give a good clue
I had the same problem in IntelliJ IDEA 15.
I fixed it by right clicking the data source -> Properties -> Schemas -> Use legacy introspector.
I found the reason of problem for HSQLDB: There is IDEA bug (i have 11.0 version).
Create db with relative path (relative of MODULE), like this:
jdbc:hsqldb:file:db_file/testDBInMemory;shutdown=true;hsqldb.write_delay=‌​false;
f:\TestModule\db_file\
When added it to Data Sources, IDEA recognizes this path as relative of $IDEA_HOME$/bin folder.
f:\Program Files\JetBrains\IntelliJ IDEA 11.0\bin\db_file\
So you have two different data bases. And when JPA updated first, Data Source doesn't see update in other.
WORKAROUND:
use absolute path in file db url.
For the latecomers still experiencing this, Intellij IDEA also has the following features which might help you as they have me:
'Force Refresh' (ctrl + shift + F5): "The Force Refresh action clears the data source information from cache and loads it again from scratch."
'Forget Cached Schema' which clears the schema cache. Does require you to set which schema you want shown again.
Right click your datasource -> Diagnostics -> 'Force Refresh' or 'Forget Cached Schema'
Source: https://www.jetbrains.com/help/idea/cannot-find-a-database-object-in-the-database-tree-view.html
The answer for me was buried in a comment, so I'm posting it here. The symptom for me was seeing an error like this:
Unable to resolve table 'thetablename'
And the table name was highlighted in red.
The following fixes are all ways to trigger IntelliJ to refresh data sources:
CTRL+ALT+Y to refresh the db stuff, or
CTRL+F5, or
Click the database vertical tab on the right, expand, right-click on each DB connection and select 'Refresh'
Kudos to #ice for answering this earlier in a comment. I'm basically just elaborating and making sure this shows up as an answer.

Creating a custom column: "Append-Only" File Upload

I'm trying to make a custom column (for a custom list), where the users can upload files without overwriting the previous - this way they can keep past versions of the files and upload newer ones and the new ones append. There already exist "append only" comment columns and file upload columns that I can see.
I'm working with Sharepoint designer 2007 (2010 doesn't work with the site), and I'm referencing this code I found online somewhere (http://pastebin.com/raw.php?i=0qN89meu), trying to research the Sharepoint documentation on MSDN. I can open the site in designer, but don't know where to go from there (it's already running on a web server, not opening it locally).
I'm just not clear on how to start, I thought there'd be a simple "right+click -> new column" feature but I can't find it. If someone could point me in the right direction to where I could start creating columns on the site, that would be great. Thanks!
An untested idea :
Create a document library with a lookup column to the custom list.
Create an event receiver (ItemAdded and ItemUpdated) than will take the attached files and move them to the other list (with the correct lookup value). --> Code with Visual Studio
Grant to this document library only read permissions.
Adapt the view to display the related documents in the dispform of the custom list.
Advantages:
this seems to answer to your need
you gain all the usability of a document library (nothing prevent you to grant edit rights to other users, force check out, etc.)
Disadvantages:
you have to play with lookup. Can be tricky sometimes, if you play with features
you split one business entity to two entities. You will have to deal with cascading delete (if you need it).

Is there a way to generate a map of the existing tables and their relationships to each other?

Access has something like this where you view all the relationships between the existing tables, displayed as lines connecting them: keys, 1 to many, etc. I can't find anything in ss2008 - I'm very new to it on top of that. Any help would be appreciated.
open up the database folder for the database that you are interested in, click on database diagram, click on yes when a confirmation box pops up
right click on database diagrams and select new database diagram
Pick all the tables you want, click add and a diagram will be created
Now you can save the diagram, give it a useful name and it will be available next time you want to look at it

Resources