I know we have an authorization attribute.
[HttpGet("{id}")]
[Authorize]
public IActionResult Get(int id)
In the startup.cs
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options =>...
I am trying to learn API development. I am using .net 3.1(my org uses VS 2019 and it is only showing me this framework). I have chosen API template(that has a sample Weatherforecast API). Upon executing it,I can see plain JSON in chrome but I wanted swagger UI).
I am getting the following error...
In my organisation. we use VS 2019 version 16.11.21. When I clicked on API template or even ASP.net MVC Core web app, it only shows 3.1(out of support). I know now .net 5.0 is also out of support but in CS 2019, .net 6.0 is not working. When I tried changing the target framework to 5.0 from...
Hello,
I have to develop an application where i have to access service now tickets. The application should access certain types of tickets and ignore the rest. Is it possible in c# to connect to service now tickets?
Secondly, how to connect to the database that resides on AWS or any other...
Hello,
I am using the following test API -
https://97mm2.sse.codesandbox.io/teachers/200
{
"message":"Required Teacher",
"data":{
"id":200,
"firstName":"Jerold",
"lastName":"Britto",
"age":28,
"email":"britto@xyz.com",
"class":10,
"students":[...
Hello,
When I click on Login, it shows the following message -
Same thing happens when I click Register and Contact us. I was finally able to login by stumbling upon the following page when I tried to visit the admin profile.
I am creating a winform app that accepts a name and position as input and upon clicking the submit button generates a barcode of that name and prints that on the entered position in a pdf file(generates this as well). The app is giving me error on Environment.Exit(1) - Error Creating Window...
I am creating a pdf using PDFsharp and saving it automatically on button click-
// Save the document...
string filename = "Barcode.pdf";
document.Save(@"E:\" + filename);
MessageBox.Show("PDF saved successfully!");
Instead of automatically saving it by...
Can we check for a part of string in hashtable key? For example, our key is
key = residentnumber +","+ housenumber
I know have a function called containskey() but do we have something that could partially check for a string in a hashtable key?
For example, if we could search...
I have a very simple query
Select * from Employees
where company = 'Company A'
order by firstName
I want to run this query to run automatically on a daily basis and save the results in excel. Is their any way I can achieve this purpose?
I tried using SQL server jobs but the output excel file...
I am trying to upload my excel 2013 file contents to sql server. Here is my code :
try
{
string connectionString = @"data source=DELL\SQLEXPRESS01 ; initial catalog = amen; persist security info = True; Integrated Security = SSPI; "...
Hello,
I am trying to upload an excel file into SQL server. The thing is I am stuck here
string fileName = Path.Combine(@"C:\", FileUpload1.FileName);
FileUpload1.SaveAs(fileName);
String excelConnString =...
Hello,
I am creating a test website for practice. The homepage looks like this -
On clicking test The view is
I want that when I click ID, a message should be displayed underneath the text box telling if the id is valid or invalid. Im using MVC architecture and connecting to database...
Hello I have always struggled with Lambda expressions in LINQ. I am trying to understand the following code that I found online . I know this might be a stupid question but I did try to read the documentation but couldnt understand much. I would be highly grateful if you could explain in simple...
I am learning MVC. I had previously worked on ASP.Net Web Applications(.NET Framework) in which we used webforms, edmx, and ado.net to connect to the database for CRUD operations. But I don't see any edmx option in ASP.Net Core Web App(MVC) .
I want to create a login page . I have the following...
Hello, I am trying to learn MVC. I first created an empty ASP.NET Core application. Then, I added a Controller.
namespace website.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
I...
I am using VS 2019. All my existing applications were working fine but all of a sudden i am getting this strange error.
When i open an existing application to edit in debug mode, it works for 2 or 3 times, but then it shows this built in error when i click on run.
I then tried working in...
I want to create a notice/circular board like this
I want the user to click on any of the notice and then the detailed notice should appear in the next window.
From this link Online Notice Board
I have figured out that they are using windows.open and popup and they are setting the text in...
I have added a column for photo in my table
alter table DailyMsg add Photo varbinary(max);
This is my stored procedue
create proc sp_viewImage
as
begin
select Photo from DailyMsg
end
Function to connect to database and return value
public byte[] getPhoto()
{...
I am trying to learn ASP.NET MVC and ADO.NET. I am making a demo website in which there would be an admin panel. The admin would update the Daily Messages which will get reflected in the main homepage. I am using ASP.NET MVC. I have created the table in database as
create table DailyMsg(Sno int...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.