Click here to Skip to main content
15,792,283 members
Home / Discussions / ASP.NET
   

ASP.NET

 
SuggestionRe: Expiry date and Update Expiry Date Pin
Richard Deeming15-Apr-19 9:25
mveRichard Deeming15-Apr-19 9:25 
AnswerRe: Expiry date and Update Expiry Date Pin
jkirkerx16-Apr-19 10:57
professionaljkirkerx16-Apr-19 10:57 
QuestionIn 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527512-Apr-19 20:17
Member 1418527512-Apr-19 20:17 
AnswerRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025415-Apr-19 8:49
User 418025415-Apr-19 8:49 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527515-Apr-19 9:46
Member 1418527515-Apr-19 9:46 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025415-Apr-19 11:05
User 418025415-Apr-19 11:05 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527515-Apr-19 17:46
Member 1418527515-Apr-19 17:46 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025416-Apr-19 4:18
User 418025416-Apr-19 4:18 
Here you go. You need to extract data from data table now in below code to populate your variables which you may be binding on screen.

DAL:

C#
public DataTable FetchDetails()
{
    con.Open();
    DataTable dt = new DataTable();
    using(SqlCommand cmd = new SqlCommand("spfetchdetail", con))
    {
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@pid", pid);
        
        SqlDataAdapter sda = new SqlDataAdapter(cmd);
        sda.Fill(dt);
    }
    return dt.Table[0];
}


BAL:

C#
public DataTable fetchdetail()
{
    return dll.FetchDetails(); // Call to your DAL returning Datatable
}


CS:

C#
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
    string pid = ""; string pname = ""; string pcid = ""; string sdesc = ""; string desc = ""; string qty = ""; string prce = ""; string len = "";
    DataTable dt = bll.fetchdetail(); // Call to BAL and reveice datatable
    // extract the data from this datatable now to populate your variables now
    HiddenField1.Value = pid;
    txt_proName.Text = pname;
    ddl_category.SelectedValue = pcid;
    txt_sdesc.Text = sdesc;
    txt_ldesc.Text = desc;
    txt_qnty.Text = qty;
    txt_price.Text = prce;
    txt_len.Text = len; 
}


modified 20-Sep-20 21:01pm.

GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527516-Apr-19 4:51
Member 1418527516-Apr-19 4:51 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025416-Apr-19 5:01
User 418025416-Apr-19 5:01 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527516-Apr-19 5:17
Member 1418527516-Apr-19 5:17 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
User 418025416-Apr-19 6:26
User 418025416-Apr-19 6:26 
GeneralRe: In 3 tier architecture , filling textboxes with values from database table Pin
Member 1418527516-Apr-19 7:04
Member 1418527516-Apr-19 7:04 
QuestionMake a title of the field goes over the field: asp MVC5 / Razor Pin
thabet idris12-Apr-19 1:15
thabet idris12-Apr-19 1:15 
AnswerRe: Make a title of the field goes over the field: asp MVC5 / Razor Pin
User 418025412-Apr-19 6:55
User 418025412-Apr-19 6:55 
AnswerRe: Make a title of the field goes over the field: asp MVC5 / Razor Pin
Richard Deeming15-Apr-19 9:28
mveRichard Deeming15-Apr-19 9:28 
QuestionDisplay a message when Radio Button is not selected Pin
Member 128239698-Apr-19 5:58
Member 128239698-Apr-19 5:58 
AnswerRe: Display a message when Radio Button is not selected Pin
Vincent Maverick Durano10-Apr-19 12:03
professionalVincent Maverick Durano10-Apr-19 12:03 
QuestionMembership section of VS2017 Web config Pin
Member 87616678-Apr-19 3:02
Member 87616678-Apr-19 3:02 
Questionwhy's the error not found namespace or class ? Pin
Member 24584676-Apr-19 21:43
Member 24584676-Apr-19 21:43 
AnswerRe: why's the error not found namespace or class ? Pin
OriginalGriff7-Apr-19 21:07
mvaOriginalGriff7-Apr-19 21:07 
GeneralRe: why's the error not found namespace or class ? Pin
Member 245846723-Apr-19 17:39
Member 245846723-Apr-19 17:39 
GeneralRe: why's the error not found namespace or class ? Pin
Mycroft Holmes23-Apr-19 20:18
professionalMycroft Holmes23-Apr-19 20:18 
GeneralRe: why's the error not found namespace or class ? Pin
OriginalGriff23-Apr-19 21:03
mvaOriginalGriff23-Apr-19 21:03 
Question.Net Core 2.2.3 with Angular, preparing for Docker Container Deployment with MongoDB running in a container, all Linux going crazy Pin
jkirkerx5-Apr-19 13:27
professionaljkirkerx5-Apr-19 13:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.