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.
Related
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.
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.
I am currently having an issue with getting the data from my Access database and displaying it into my visual studio app. The database and app is set up and linked correctly, I just need to know the code that allows you to search within the Access database (using a primary key) to receive the data in a different column and insert it into a string in the C# code. For example:
I have a row with id = 3 within the Access database and need to access the data of a different column within that same row. What I need to know is how to search for that id using C# code in the microsoft form and setting a string equal to that data in the database.
If you are using Windows 7, the Jet Engine does not work.
I'm using Visual Studio 2008 and an Access 2007 database.
While I'm trying to create a new insert query in my DataSet, the insert stored procedure mixes up the database field values.
I have a print screen of the problem here: http://netplague.eu/Capture.PNG
As you can see in the attached print screen the table clients is displayed and below the InsertClient stored procedure. My problem is that the parameters are all mixed up.
Is there a solution to this problem or is it just a visual studio bug?
Thank you.
It's probably just a display order issue.
If you are inserting the parameters in alphabetical order of the field names, but Visual Studio is displaying the fields in the order they are defined in the database (for example), this would explain the difference.
I had your same problem. I have fixed it installing the service pack 1 for Microsoft visual studio 2008. I hope this help.
Simone
I have a Crystal Report that was designed against a dev database. When I load it into the live system I need it to run a different but equivalent database. Normally I just run reports through some code in C# that sets the connection info, parameters and calls VerifyDatabase on the report and subreports and it all works well.
In one particular report this doesn't work though and doesn't seem to verify anything and the report crashes with an error 'The field name is not known' in one of the sub reports. With this report if I manually verify it in the Crystal Reports application against the live database then it all works fine.
So the question is, is there anything different that Verify Database function in the Crystal application does that I should do in code other than set connection info, parameters and call VerifyDatabase method?
Edit: Some more info on what I tried
Get a backup of the live database and put it on our dev environment.
Manually verify the report against this database (which is exactly the same structure as live)
Load the report into the live system and run it.
Error still occurs.
The 'field name is not known' error usually means that you have placed a field on the report or used it in a formula (etc), but the field no longer exists in the database. As I understand it, calling VerifyDatabase can update the field list for the views/tables in the report, and can remove fields from the report if they no longer exist, but it cannot fix formulas or subreport links which depend on a missing field.
It seems to me a better practice to make sure that the database is in sync (verified) before deploying the report so you don't need to call VerifyDatabase every time.
All that said, I don't see why it would work after manually verifying, but not after calling VerifyDatabase. Sometimes Crystal is weird that way. You might try recreating the subreport (if it is simple), or removing it and rebinding it to try to trick the error into going away.
It sounds like a confusion between two versions of Crystal and their capabilities. The version that comes with dotNET 2008 is Crystal Reports Basic for VS2008, masquerading as Crystal 10.5 (which doesn't exist as a standalone product). But if you're referring to standalone reports developed by themselves outside of the Visual Studio IDE, then this will be a different version of Crystal with some differences in capability. I'd say this report was created in a different version of Crystal to the others, and that the Verify within the code is coming across some feature that 10.5 can't recognise.
If you have a standalone version of Crystal (which will need to be either Crystal Reports 2008, or a Developer edition of an earlier version), use this to make sure you're using the same Crystal version in the app as in in report development.
Could you verify this:
While the debugger is running, if the schema in a typed dataset is changed and you run Verify Database the messagebox always displays "Database up to date" even though there is a difference in the two schemas.
This took me a while to figure out because the Verify Database action was not disabled when the debugger was active.