Convert nupkg file to zip file and you will get dll files in it.
On the right hand side of nuget website you will get "download package" option.
Convert nupkg file to zip file and you will get dll files in it.
On the right hand side of nuget website you will get "download package" option.
using System;
using System.Data.SqlClient;
public class SqlPrintExample
{
public static void Main(string[] args)
{
string connectionString = "Data Source=YourServer;Initial Catalog=YourDatabase;Integrated Security=True";
string sqlQuery = "PRINT 'This message comes from SQL.'; SELECT GETDATE() AS CurrentDateTime;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
// Attach an event handler to capture InfoMessage events (including PRINT statements)
connection.InfoMessage += Connection_InfoMessage;
or// conn.InfoMessage += new SqlInfoMessageEventHandler( Connection_InfoMessage);
try
{
connection.Open();
using (SqlCommand command = new SqlCommand(sqlQuery, connection))
{
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine($"Current Date Time from SQL: {reader["CurrentDateTime"]}");
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
private static void Connection_InfoMessage(object sender, SqlInfoMessageEventArgs e)
{
// Display the message from the SQL PRINT statement
Console.WriteLine($"SQL InfoMessage: {e.Message}");
}
}
For data looping in sql Server, we use While loop or cursor
DECLARE @cnt INT = 0;
WHILE @cnt < 10
BEGIN
PRINT 'Inside simulated FOR LOOP on TechOnTheNet.com';
SET @cnt = @cnt + 1;
END;
PRINT 'Done simulated FOR LOOP on TechOnTheNet.com';
GO
For cursor:-
https://www.c-sharpcorner.com/blogs/how-to-use-cursors-and-while-loop-in-sql-server
using (WebClient client = new WebClient())
{
string url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOJA1ZDa4CQ6OwLx-iL10cLEXpzoJZmZUVLHjJqHBr3-Q9TBEBpjD_ZZgtNGMj59CXGWtZ1yu-CfUoyuU8I7nGjgpwk0wCal_oGSPZNREQssIHeC5PFC10v8YdEIe5ie2wLyfGsrHSBR213ATgNXPyotNs66AoYF2CWPfAx9gu2cgYKw/s1600/Screenshot%202025-05-14%20184428.png";
string savePath = "D:/image1212.jpg";
client.DownloadFile(url, savePath);
}