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
David Katanski
NA
4
609
New to C# - Need a code check
Jul 9 2019 4:14 PM
Hello, thank you for reading. I'm brand new to C# and C # Corner.
I'm working on submitting an invoice via XML, however I keep getting an error on the XmlReader line (line 13). I know the Sql connection and properties are correct becuase I copied them over from another connection in my solution that I know works.
Not sure what I'm missing, anyhelp would be greatly appreaciated!
public
void
SubmitInvoice()
{
SqlConnection myConnection =
null
;
try
{
// Create Instance of Connection and Command Object
myConnection =
new
SqlConnection(Settings.connectString);
SqlCommand myCommand =
new
SqlCommand(
"usp_Get_Invoice"
, myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandTimeout = 300;
myConnection.Open();
XmlReader results = myCommand.ExecuteXmlReader();
if
(results.Read())
Reply
Answers (
2
)
How to Use SOCKS5 proxy to access AWS API
How would I go about testing a complex nested JSON file?