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
Chidiebere Mgbemena
NA
179
14.2k
error in bill view/Print summary
May 25 2020 4:38 PM
Thanx for all the help guyz i appreciate, as i said earlier i am new to c# that is why i need your help with this project am working on.
I am trying to view bills and print summary but am getting this error, please help detect the problem.
Thanks
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
using
System.Data.SqlClient;
namespace
NSPM_Sales_Invoice
{
public
partial
class
ViewBills : Form
{
SqlConnection con =
new
SqlConnection(Properties.Settings.Default.NSPM_Sales_InvoiceCon);
SqlCommand cmd;
SqlDataAdapter da;
DataTable dt;
public
ViewBills()
{
InitializeComponent();
}
private
void
ViewBills_Load(
object
sender, EventArgs e)
{
con.Open();
da =
new
SqlDataAdapter(
"Select * from Tbl_HeaderData order by JobNo asc"
, con);
con.Close();
SqlCommandBuilder cb =
new
SqlCommandBuilder(da);
dt =
new
DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
}
private
void
btnViewBills_Click(
object
sender, EventArgs e)
{
con.Open();
da =
new
SqlDataAdapter(
"Select * from Tbl_HeaderData where JobNo between '"
+ dateTimePicker1.Value.ToString(
"yyyy-MM-dd"
) +
"'and'"
+ dateTimePicker2.Value.ToString(
"yyyy-MM-dd"
) +
"'order by JobNo asc "
, con);
DataSet ds =
new
DataSet();
da.Fill(ds,
"Tbl_HeaderData"
);
dataGridView1.DataSource = ds.Tables[
"Tbl_HeaderData"
];
con.Close();
}
}
}
Reply
Answers (
5
)
.Net Core Upgrade Issue
Fee Management System Database