Jonh Jonh - 1 year ago 77
ASP.NET (C#) Question

Database code please review and tell me whats i'm doing wrong

I want to search in database for particular file which was inserted. Below is my code. Please tell me whats i'm doing wrong.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Data;
public partial class StudSearchNotes : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
Server.Transfer("StudShowNotes.aspx?docid=" + GridView1.SelectedDataKey.Value);
protected void btnSearch_Click(object sender, EventArgs e)
DataView dv=(DataView)SqlNotes.Select(new DataSourceSelectArguments());
if (dv.Count == 0)
lblmsg.Text = "No Result Found";
lblmsg.Text = "";

Answer Source

You missed importing the namespace using System.Web.UI;

Hope it helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download