This is my first time using SQL Server and I am planning to make a WPF C# application that connects to SQL Server to save users and other data. I was following a Youtube video tutorial but I came up with this problem when trying to test the data within my tables:
I am trying to display the data within my 'Accounts' table through this query
I have tried looking up the problem and the first thing that came up was that "master" was wrong, I selected msdb instead, however it did not fix the problem
This might be a very simple problem but this is my first time using SQL and databases.
UPDATE: I did
DB_NAME()
and it came back as 'master'
Help would be much appreciated!
At the top, in dropdown select your 'database name' instead of 'master database'. I guess Accounts table is in Database1.mdf. Please select Database1.mdf.
VS 2017
DEVEXPRES 17.2
Wpf
Table
The Access file is located
c:\test\visualStudio\csharp\prb\00_DB\dbAccessTest.accdb
If I correctly understood, then the way should be written here (see screen)
I get a mistake
"Invalid property path syntax."
I found nothing in the documentation.
Question.
How to connect "TreeListControl" to the database table "Access" with the help of the designer?
I have the following MYSQL query:
SELECT
stat_number,
sqldate,
sqlvalue,
ID,
CAST(GROUP_CONCAT(IF(YEAR(sqldate)= 2013, sqlvalue, NULL)) AS UNSIGNED) AS Y2013,
CAST(GROUP_CONCAT(IF(YEAR(sqldate)= 2014, sqlvalue, NULL)) AS UNSIGNED) AS Y2014,
CAST(GROUP_CONCAT(IF(YEAR(sqldate)= 2015, sqlvalue, NULL)) AS UNSIGNED) AS Y2015,
weekofyear(sqldate) AS `weekofyear(sqldate)`
FROM statval1
WHERE (stat_number = 495) AND (sqldate >='2013-01-01' OR sqldate <'2015-12-31')
GROUP BY weekofyear(sqldate)
ORDER BY weekofyear(sqldate)
It works great everywhere else EXCEPT in Visual Studio 2013 query Editor,
Does anyone knows how to make it work? or what is wrong with the query editor?
I keep getting the error:
Error in list of function arguments: '=' not recognized. Error in list
of function arguments: 'AS' not recognized. Unable to parse query
text.
If i ignore the error and keep going the datagrid seems to display the correct data, but nothing shows in the charts, I get no columns at all to select the x,Y axis. I recently started learning C# in Visual studio 2013 and I am trying to recreate a software that I made in PHP/MYSQL and recreated in Object Pascal/MYSQL but this is really putting me off visual studio.
It only took a couple of weeks to create a reporting software in Lazarus, pascal programming from not knowing anything at all, and it has taking me a week just to get MYSQL server talking properly with in Visual Studio 2013 and now the query do not work, but they work perfectly fine with object-pascal, PHP, JAVASCRIPT, ETC.
The lines baffling VS2013 are the ones like this:
CAST(GROUP_CONCAT(IF(YEAR(sqldate)= 2013, sqlvalue, NULL)) AS UNSIGNED) AS Y2013,
Your query works OK otherwise in VS2013.
But, what does this query mean? Are you sure it's well formed? You're taking advantage of MySQL's nonstandard extension to GROUP BY in an inscrutable way. Read this: http://dev.mysql.com/doc/refman/5.6/en/group-by-handling.html
You might consider reworking this query so it's standard.
Also, this date selection logic omits the last day of 2015. Is that what you want?
(sqldate >='2013-01-01' OR sqldate <'2015-12-31')
I could be wrong, and will be glad to be proven wrong but the VS 2013 query editor is geared towards MS SQL and only knows that syntax. The query is ok for MYSQL but in MS SQL you can not name a variable inside a function call.
Anyone else have any insight into this as I'm now curious as well?
My advice is : try to remove each attributes of the select statment and test if the query is responding an error.
With this way you can locate which attribute is giving that error.
I think , but im not sure that, the error is caused by thos : ‘ ’
Try to remove them as well.
Maybe someone can help me. As part of a college project I am attempting to design a number of tables within MS Visual Studio. We had previously designed these tables using Microsoft Access and one of the fields had a data type of Yes/No. In other words the data which was been saved to the particular field in the table would only contain a yes/No value.
Is there any way to replicate such a data type in Microsoft Visual studio. We are using an SQL server database and I am able to create the table but the only thing I am unable to do is to set the value type to replicate the yes/No value in Access. I would have assumed there would be an option to set values as boolean data type but this option is not present.
To clarify the version of Visual Studio is 2010 Professional and we are building the particular tables in C#.
Can anyone advise on an alternative option to Yes/No which will still return a true/false value or even a 0/1 value would do fine.
In SQL Server you can use a bit column: http://msdn.microsoft.com/en-us/ms177603
There is the data layer where the data is stored (your DB) and there you can set tinyint or bit as your datatype (assuming you are in MS SQL since you are in in VS an C#)
And there is also the presentation and application layer where in (case you are not in WPF) are in the same .cs, where you can define a radiobutton or checkBox control find in VS 2010 toolbox, to show the corresponding data.
Hi I keep getting this error using a sqldatasource in asp.net, I can connect and see mysql schema and it lists everything fine but every query I test is returned with an error even the manualy inputted ones.
Visual Studio IDE doesn't supports schemas yet, so you would need to manually Pre-pend Table's Schema name in the Query.