Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
How to display the number row records in sql to textbox?
Amrul Hakim
7y
248
1
Reply
this my code ;
Thank you
public
MainDashboar_C()
{
InitializeComponent();
}
SqlConnection conn =
new
SqlConnection(@
"Data Source=AM-PC\SQLEXPRESS;Initial Catalog=Management_Gudang;Integrated Security=True"
);
public
SqlDataReader READER;
private
void
Tampikan_Label()
{
conn.Open();
SqlCommand CMD =
new
SqlCommand(
"Select COUNT(*) From Stok_Barang "
, conn);
READER = CMD.ExecuteReader();
if
(READER.HasRows)
{
txt_BarangMasuk.Text = READER
.ToString();
}
Else
{
txt_BarangMasuk.Text = "0";
}
}
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to set column width when export datagrid to excel in wpf
MVC how toCreate dynamic Menu bar in Layout page.