14 Replies
You can type in your question whole when creating the topic, no need to leave it for a separate comment
Just so you know
ok
my bad
next time i'll write it before
but, i just wanna know how can i read the answer of a query
i'm used with the Angular server, that usually takes some hours/days to people help you
1- i made a query that gets me a value
2- i wanna take this value and compare with another variable
Show some $code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/
i send a parameter (actual date) and want to find if there's rows in the same date with an specific ID
Ah, using regular ol' ADO.NET
SqlCommand Class (System.Data.SqlClient)
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
Here's an example of retrieving the data
Long and painful, but that's ADO for you
HM, i'll take a read
btw the another question that i did about getting actual date without time worked perfectly, thanks
nice
thanks, next time i'll elaborate the question first
A protip for the database, too: if you don't have any restrictions as to what libraries and stuff you can use, consider using Dapper instead of ADO
Makes code much more sane
Lets you map SQL query results directly to C# objects
hmm that's awesome
i'll search about it thanks
we actually just use pure Winforms + SQLServer
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.