Firstly, those Convert statements make me suspect you're storing your times as varchar, which is absolutely the wrong thing to do. Aside from the fact that there is no validation to ensure the column value is a valid time, it will also take up a...
You haven't specified which version of SQL Server you're using. Assuming 2017 or later, the simplest solution is to use STRING_AGG[^]: SELECT acctnum, STRING_AGG(note, ' ') WITHIN GROUP (ORDER BY srno) As note FROM YourTable GROUP BY...
If what you are looking for is to get the result as a single query result, then try this: SELECT (SELECT COUNT(*) FROM Customer) AS CustCnt, (SELECT COUNT(*) FROM Transactions) AS TransCnt, (SELECT COUNT(*) FROM prod_cat_info)...
add below code at the last after all parameters have added.cmd.ExecuteNonQuery();I did not see below ExecuteNonQuery code in your code.command.ExecuteNonQuery();
If you weren't going to listen when I told you yesterday: C# VS, sqlexpress - how do I use the datatable value and make a simple times calculation with textbox and appear the result in second textbox C#?[^] then why are you askign the same question again today? I assumed after the extensive...
Please do some research and come back with a specific question (i.e. please read the posting guidelines) Some starters ... Securing SQL Server - SQL Server | Microsoft Docs[^] Everything You Need to Know about SQL Server Security | IEEE Computer...
The error is quite clear. You cannot restore a database that was backed up with a newer version of SQL Server onto a server running an older version. You will either need to upgrade your instance of SQL Server or find another instance that has...
SqlCommand cmd = new SqlCommand($"InsertintoSalesInvoice {InvoiceNum},{ItemId},{qty},{SalePrice},{discount},{AmountAfterDiscount},{Paid},{Remain},{Total},{PaidDate},{CustomerId} ", cn); That's not a valid SQL command, or even close. INSERT INTO...
This is not about your problem, or maybe it is, but you're using string concatenation to build the SQL query. This is a MASSIVE security problem and risks the destruction of your database. It amy also be causing your problems, whatever they are. ...
I concur with Dave - you should never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When you...
In addition to using parameterized queries as stated above, you have a value for your 'Tag_Type' field missing, jumping from 'WRAtts.QTY' to 'WRAtts.Dwg_Number'. To use parameterized query - Dim strconx As String = "Data...
There's few ways to achieve that. I'd like to provide a sample with Common Table Expressions: ;WITH CTE AS ( SELECT 1 Lvl, acctnum, note, srno, note newnote FROM Table1 WHERE acctnum IS NOT NULL UNION ALL SELECT C.Lvl +1, C.acctnum,...
Don't do that. Don't store CSV data in a single column, it's wasteful, inefficient, and leaves you with nasty problems whenever you want to use the data or change it. SQL string handling is ... um ... poor, so you have to jump through a lot of...
Hi guys.I have this case.Right now, im try to install an app. AND use SQL Database Desktop Engine 2000but , so far when i try to install my App in OS windows 8 or higher, then in the installation throw me an error of Compatibility, is for that, 'cause i need upgrade my Data base engine,...
OK, I figured this out in about 15 seconds just by trying the Custom and Download Media options.Yes, you can download just the core engine installation (411MB) and install that. Just click the Download Media button and click the "Express Core (411MB)" option. Give it folder to download to...
I have simple form which reads users name,email and city. I have created a database and a table with fields id,name,email and city. When i run the code i don't encounter any error or exceptions. But unable to see the inserted data into table.following is my codeSqlConnection con = new...
According to info from Requirements and compatibility | Team Foundation Server Setup, Upgrade and Administration[^] SQL Server 2014 or 2012 are supported. If you're using SQL Server 2016, we require a Visual C++ runtime update to be installed.
im new to this i wanted to create only a plus calculation with button&txtbox and display it in other textbox using the data int in my sqlexprs db. i've created a db and dtable in sqlserver management tool there is only product name and price. how do i do this.. pls give an example What I...
Does anyone have a good tutorial to learn how to add a record into an SQL database? The database is laid out with one primary key table and 9 foreign key tables that are related to it, or I suppose that it relates to. I know how to insert data from a form into one table that has no keys...
The updating of the indexes is "transparent". So, your question boils down to "how to insert a record". If your question is: how do I create a database with primary and secondary indexes, then that's another question / story. If in the process of inserting a record you violate secondary index...
My database was running fine ,I made no changes to it and all of a sudden it started giving me errors in insert query such as Msg 102, Level 15, State 1, Line 11 Incorrect syntax near '
Simple: get rid of the '' characters and the datatypes: INSERT INTO [dbo].[userRegistration] ([userName] ,[userEmail] ,[userPassword] ,[userDesignation] ,[userPhone]) VALUES ...
The Conversion failure comes from the one record in table getalldata that has a value of string 'active' in column '[Active]' If you expand your generated sql an perform it step by step SELECT TOP 1 'PL' AS 'PL' ,'Company' AS 'Company'...
Hi All, I want to do store procedure encryption with password, basically want to hide the logic behind the procedures... With Encryption (can easily decrypted by db forge decryptor I tried my self). Procedure Locking will not work as well if it...
WITH ENCRYPTION is the only security you can implement: any other system would make the SP unreadable by SQL Server and render the SP useless and unexecutable! If you want secured processing, you will have to move it to the presentation software.
hi Friends, I am inserting records into a datatable after insertion , max(sno) lessathan rows I am deleting. No When record is not inserting means SNO is not changing I need to delete that record immediatly.I have row created time field in the...
Look at your line of code SET @SQLSTRING = 'DECLARE @RETURN_TABLE TABLE ('+@STATIC_COLUMN+' NVARCHAR(255) NULL,'+@TEMPVARCOLUMNS+') when you pass @STATIC_COLUMN as '[CompanyID]' @SQLSTRING will read DECLARE @RETURN_TABLE ([CompanyID]...
update-database after adding migration on package manager console of Visual studio 2022 brings the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or...
OP has confirmed that they have never been able to connect to this database, so the addition of the package manager is not related. The connection string being used to attempt to connect to the database is incorrect. See SQL Server connection...
We can't help - we have no idea what part of that is working on what value. All we - and presumably you - know is that something is trying to parse a string to a DateTime value, and it's probably the dateTimeNOW.Text property assignment. And we...
If f_Patient.dateTimeNOW is a DateTimePicker Control[^], you need to pass proper date/time value instead of string! So, this is wrong: f_Patient.dateTimeNOW.Text = this.DGV.CurrentRow.Cells[7].Value.ToString(); try: f_Patient.dateTimeNOW.Value...
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
In addition to Solution 1 ... You have not described your logic and it is not clear what your logic is to get to those figures. You seem to - switch between a 30 day month and a calendar month (I am assuming that EMI is the amount to...
Hello, I have a query where I am trying to select tags that are uploaded every second, on a 1 minute and 30 second interval. I have declared a start of current month and previous month as this will run once a month. declare...
DECLARE @CurrentDate as date SET @CurrentDate = GETDATE() DECLARE @monthAgo as date SET @monthAgo = DATEADD(month, -1, @CurrentDate) SELECT TOP (10000) FloatTable.[DateAndTime] ,FloatTable.[Val] ,TagTable.[TagName] FROM...
The error message is pretty clear: The ConnectionString property has not been initialized. (System.Data) It means what it says: you haven't provided the Connection string which tells the system which instance of SQL Server you want to connect to....
Your view query uses two INNER JOINs - which only return rows with matching data in both tables. So the most likely thing is that the JOINs are causing the reduced data because some of the ON conditions aren't matching in both tables. for some...
I need to get data from table in SQL DB for particular time duration. table as below ID Start Time End Time 1 07:00 15:00 2 15:00 23:00 3 23:00 07:00 I need to design...
Hi. I Want Silent installation of SQL Express 2019 with the Advanced Installer program. I using Below Parameter for this, But only the extraction part is worked and SQL Express not installed. it seems is getting error, But no error show. also I...
Firstly make sure you have the necessary permissions and that your SQL Server is configured to allow connections from your Xamarin Forms app. Then make sure you have the correct dependencies and configurations in your Xamarin Forms project....
The real question is "why are you installing SQL Server at all?" You probably should not include SQL Server in your installation. There are a couple of reasons: 0) You can only distribute SQL Server Express for copyright reasons - not SQL Server...
Um. I see nothing that involves your DataTable outside the method in which you load it (and you'd be better off doing that with a DataAdapter rather than a DataReader - it involves a lot fewer round trips to the DB), so quite what you want to do is not obvious. But ... two things do spring to...
select name from [mytablenmame] where CanAccess=1 [EDIT] Given the OP's sample data, where there are only TWO records for a given name, and EACH of them having a different value for CanAccess, aggregation is not required to get the results he claims to be after. Stop 1-voting my answer. [/EDIT]
I work on sql server 2012 I face issue when make pivot for data I get error Conversion failed when converting the varchar value 'Active' to data type int. so how to solve this issue please table script as below CREATE TABLE [dbo].[getpldata](...
I am attempting to write data into a SQL table. Here is the code. Dim strconx As String = ("Data Source=.\SQLEXPRESS;Initial Catalog=Connex_Test;Integrated Security = true") Dim connectionx As New SqlConnection(strconx) ...
Well, the Solution that i did, was to Remove the Folder in Start up programs hahhai know, this is not the best solution but, works for me, because i don't want that the client play with SQL tools Thanks for your time guysBest regards.
Dear Friend, I am not able to add database table in Visual studio 2015 through server explorer. When i try to add the table it shows a GIF image stating "Loading... The design surface is loading." I am using SSMS2017, SQL SERVER 2016 and Visual Studio 2015. Kindly help me for same. Kind...
sorry im bad at coding but i need this, well.. in my table called Products got 2 column there is Product and Price in Price column contains a decimal value 1000 can i get that value(1000) to be a variable so i can use it into arithmetic function? and it seems to connect the database to my...
SELECT COUNT(*) FROM Customer UNION SELECT COUNT(*) FROM Transactions UNION SELECT COUNT(*) FROM prod_cat_info What I have tried: SELECT COUNT(*) FROM Customer UNION SELECT COUNT(*) FROM Transactions UNION SELECT COUNT(*) FROM prod_cat_info
i need to Edit row in database from DataGrid View the Problem is i need solution for System.FormatException: 'The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.' i click f10 and compiler work my...
I want to create invoice Error Is An unhandled exception occurred while processing the request. SqlException: Incorrect syntax near '/'. Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action...
Below is the table t1 in SQL with column like this, srno is the sequence just use to move cursor. acctnum(c1) note (c2) srno 12 abc 1 efd 2 xyz 3 15 pqr ...
Hello, I have following sort of records returned from a query. Name ===== CanAccess -------------------------------- Payroll ===== 0 Payroll ===== 1 Employees ===== 0 Employees ===== 1 Inventory ===== 0 Finance ===== 0 I want to select unique records from same Name if "CanAccess" is true for...
I work on SQL server 2012 i face issue when using multi column ON COLUMN as companyid,Year exec [dbo].[USP_DYNAMIC_PIVOT] '[CompanyID],[Year]','MetarialID','Metarialperc','#KTempSemlterfinialRows','max' it give me error as Msg 173, Level...
I design desktop Application for Clinic when i add new Patient when i run code my Error IS Error InvalidCastException: Invalid cast from 'System.String' to 'System.Byte[]'. What I have tried: my Code function Add : public static class...
I have number of loan related data in sql database and I want to process each records based on some logic. Logic and sample is as follows. I want to split EMI amount in multiple days/months slab I have One record like. Ac Balance EMI ...
i have been trying to import a dataset to y microsoft SQL server it keeps giving me this error messege "SQL Server Import and Export Wizard The operation could not be completed. ADDITIONAL INFORMATION: The ConnectionString property has not been...
I Can't Restore Backup from SQL Server Database I use SqlServer 2019 Error is TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore of database 'LapShop' failed....
I have the below table structure. Having All Designations. CREATE TABLE [dbo].[Designation]( [DesignationNo] [int] IDENTITY(1,1) NOT NULL, [DesignationName] [nvarchar](50) NULL, CONSTRAINT [PK_Designation] PRIMARY KEY CLUSTERED (...
I have problem with connection to database XAMARINE forms Normal C# windows form app work with this string SSMS work normal with this credential string connectionString = "Data Source=sql.bss-solution.info,1433;Initial Catalog='ABC 2023';User...