Context: I’m developing an app for windows in Visual Studio that has a table of stock materials and another of buyed materials, both in a Sql Server. I want that every time you buy something it is added into the stock table. I’m new in using SQL with c# combined. I’m trying this from a tutorial, but does nothing. Not
Tag: visual-studio
Execute query and populate the same in datagrid Box
I have a winform app connected to access database as data source , but in access i was using this below SQL to generate a query table called trend: But i do not know how execute this & populate the same in datagrid box on form load event(dataset:CSCdataset) , please help me. Answer I guess you can find more information
A problem with the foreign key using Entity-Framework
Im using Entity Framework and have this two classes: And I instance a new Product like this: When I add and save this object, does not record it in the database, but if I instance the product with a NULL value in the Client attribute, does appear but with that NULL value. I dont know why this is happening… Answer
SQL query to display data in gridview
I have a grid view that displays data from a SQL Server database during page load. My gridview contains these columns: I have used a query: which will display data from SQL Server in the gridview when ReturnedOn column doesn’t have any data. The new query has to satisfy these conditions, It Should not displays a record when Assetype=”Laptop” or
How to check if a specific data exist in a text file before insert it to SQL database table?
I have a Employee text file employee.txt which has some data in it. For instance: I want to read the file and get the empId from it and pass it to a function to check if that empId already exists in the SQL database table. Here’s my function: How do I get the empId from the file? And how to
Drag and Drop not working with external monitor [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I’m working on a small project for my studies. It’s the first contact with SQL in Visual Studio 2019 Community
How to get count of Rows automatically when a New Row is added and Rows are to shown as Columns in SQL Server
I am using this query: SELECT * FROM tbcount PIVOT (COUNT(Id) FOR Name IN (F1, F2, F3, F4, F5, F6)) p and result is F1 F2 F3 F4 F6 9 9 8 8 8 But I have kept F1 TO F6 fixed I want that …
Convert SQL Integer into c# string for combobox (Access Database)
The following code gives me an IndexOutOfRange error. ‘Baujahr’ is an integer column in my access-database. cbFahrzeugBJ.Items.Add(reader[“Baujahr”].ToString()); Here the reader: OleDbDataReader …
C# win forms app hangs
The following code is for reading from an Access DB and transferring to a SQL DB. Can anyone tell me why this code just hangs after it is run ? I have a label that should change telling me the row that is being processed but the Form just sits and becomes unresponsive once I have clicked the button. Everything
Incorrect syntax near the keyword ‘Table’ C# SQL [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 7 years ago. Improve this question Hello I’m trying to figure out why i have this error Incorrect syntax near the keyword ‘Table’. Thx in advance Code :