TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abraham Olatubosun
NA
471
114.7k
With Core 2.2, How to reference a file programmatically
Dec 27 2019 5:33 AM
Dear All,
Hope this question meet you all in good health and happy holiday,
I am trying to access a file from a folder programatically like this :
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Threading.Tasks;
using
Microsoft.AspNetCore.Mvc;
using
System.Data;
using
System.Data.SqlClient;
using
System.IO;
using
System.Net.Http;
using
System.Net.Http.Headers;
using
System.Text;
using
System.Text.RegularExpressions;
using
System.Web;
using
IQCARE_NMRS.PayLoads;
using
Microsoft.Extensions.Configuration;
using
MySql.Data.MySqlClient;
using
Microsoft.AspNetCore.Hosting;
cmd.CommandText = System.IO.File.ReadAllText(
HostingEnvironment
.MapPath(Path.Combine(
"~/procedures"
,
"spGetEncountersAndLabs.sql"
)));
cmd.ExecuteNonQuery();
the the above text in red is the error part i am need you guys to show me what am not doing right.
I need your help since i am new in asp.net core
Thanks
Reply
Answers (
1
)
What is exact used of Native Methods ? Where it will be used
How to split a string and convert it into a datetime ?