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
Nathan
NA
24
15.5k
Retrieve Data as per the ListView selection in C#
Feb 27 2014 5:34 AM
Sir, I want your help in guiding me to get a function result. Take a look to the following form:-
In this form I want to display textboxes with database value as per the listview selection. The database value are:-
The C# form.cs code I wrote for this is:-
try
{
string cnn = ConfigurationManager.ConnectionStrings["MSCon_Pharm"].ToString();
SqlConnection cn = new SqlConnection(cnn);
cn.Open();
SqlCommand cmd = new SqlCommand("GetTaxSlabDetails", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("as_Name", SqlDbType.NVarChar, 50).Value = lstTaxSlab.FocusedItem.ToString();
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adpt.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
txtSlabName.Text = ds.Tables[0].Rows[i]["Name"].ToString();
}
}
catch (Exception)
{
throw;
}
in this, the row become Zero and the loop exists.
Reply
Answers (
1
)
Splash Screen
how can insert a image into sql and than use it