Click here to Skip to main content
15,925,723 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Generaldisplay data in list box with multi column Pin
Piyush Vardhan Singh9-Dec-07 18:42
Piyush Vardhan Singh9-Dec-07 18:42 
GeneralRe: display data in list box with multi column Pin
Sun Rays9-Dec-07 18:58
Sun Rays9-Dec-07 18:58 
GeneralRe: display data in list box with multi column Pin
Piyush Vardhan Singh9-Dec-07 19:32
Piyush Vardhan Singh9-Dec-07 19:32 
GeneralRe: display data in list box with multi column Pin
Sun Rays9-Dec-07 19:41
Sun Rays9-Dec-07 19:41 
GeneralRe: display data in list box with multi column Pin
Michael Sync9-Dec-07 19:00
Michael Sync9-Dec-07 19:00 
GeneralRe: display data in list box with multi column Pin
N a v a n e e t h9-Dec-07 19:37
N a v a n e e t h9-Dec-07 19:37 
GeneralPoblem regarding port the .dbf files into Sqlserver Pin
Aavesh Agarwal9-Dec-07 18:38
Aavesh Agarwal9-Dec-07 18:38 
QuestionFind String in string Pin
AnhTin9-Dec-07 17:24
AnhTin9-Dec-07 17:24 
GeneralRe: Find String in string Pin
Christian Graus9-Dec-07 18:49
protectorChristian Graus9-Dec-07 18:49 
GeneralRe: Find String in string Pin
Michael Sync9-Dec-07 18:57
Michael Sync9-Dec-07 18:57 
GeneralRe: Find String in string Pin
Michael Sync9-Dec-07 18:58
Michael Sync9-Dec-07 18:58 
QuestionSitemap Path Pin
Member 46484919-Dec-07 17:00
Member 46484919-Dec-07 17:00 
GeneralRe: Sitemap Path Pin
Sam Xavier10-Dec-07 18:37
Sam Xavier10-Dec-07 18:37 
QuestionHow to develop Message Board Application in ASP.net Pin
Rajesh_K_Sharma9-Dec-07 16:59
Rajesh_K_Sharma9-Dec-07 16:59 
AnswerRe: How to develop Message Board Application in ASP.net Pin
Christian Graus9-Dec-07 17:10
protectorChristian Graus9-Dec-07 17:10 
GeneralVb.net AND C# Pin
AnhTin9-Dec-07 16:09
AnhTin9-Dec-07 16:09 
GeneralRe: Vb.net AND C# Pin
leckey9-Dec-07 16:13
leckey9-Dec-07 16:13 
GeneralRe: Vb.net AND C# Pin
Christian Graus9-Dec-07 16:19
protectorChristian Graus9-Dec-07 16:19 
Questionset login user control to my site from a data base Pin
Knowledgestudent9-Dec-07 15:46
Knowledgestudent9-Dec-07 15:46 
GeneralRe: set login user control to my site from a data base Pin
Christian Graus9-Dec-07 16:16
protectorChristian Graus9-Dec-07 16:16 
GeneralRe: set login user control to my site from a data base Pin
Knowledgestudent9-Dec-07 16:46
Knowledgestudent9-Dec-07 16:46 
QuestionHow to save filename in korea language while exporting gridview to ecxel. Pin
Rajesh_K_Sharma9-Dec-07 13:56
Rajesh_K_Sharma9-Dec-07 13:56 
GeneralGridView on MultiView / View with MenuItems to change Views - the problem Pin
Member 47002259-Dec-07 12:28
Member 47002259-Dec-07 12:28 
GeneralRe: GridView on MultiView / View with MenuItems to change Views - the problem Pin
Michael Sync9-Dec-07 15:15
Michael Sync9-Dec-07 15:15 
AnswerRe: GridView on MultiView / View with MenuItems to change Views - the problem Pin
Member 47002259-Dec-07 18:33
Member 47002259-Dec-07 18:33 
Hi Michael,

Here's what I'm doing: for the common part of the page, I am using dataset to populate some textbox controls, then for the details part - I'm using GridViews with a SqlDataSources. Each of the GridViews are placed on a View control being changed by MenuItem clicks. Here are some code:
protected void Page_Init(object sender, EventArgs e)
{
projectId = Convert.ToInt32(Session["ClickedId"]);
string [] dataKeys = {"MethodSID"};
conn = new SqlConnection();
// Get the ConnectionString dynamically
conn.ConnectionString = ConfigurationManager.ConnectionStrings["EEM-NEWConnectionString1"].ConnectionString;
dsrcMethods.ConnectionString = conn.ConnectionString;
Parameter param;
dsrcMethods.UpdateCommand = "update tblMethod set MethodName=@MethodName, MethodDesc=@MethodDesc,"
+ "TaxonomicalKeys=@TaxonomicalKeys, TaxonomicalDesc=@TaxonomicalDesc"
+ " where MethodSID=@MethodSID and ProjectID=" + projectId;
dsrcMethods.InsertCommand = "insert into tblMethod (ProjectID, MethodName, MethodDesc, TaxonomicalKeys,"
+ " TaxonomicalDesc) values (" + projectId + ",@MethodName,@MethodDesc,"
+ " @TaxonomicalKeys,@TaxonomicalDesc)";
param = new Parameter("MethodSID", TypeCode.Int32);
dsrcMethods.UpdateParameters.Add(param);
param = new Parameter("MethodName", TypeCode.String);
dsrcMethods.UpdateParameters.Add(param);
dsrcMethods.InsertParameters.Add(param);
param = new Parameter("MethodDesc", TypeCode.String);
dsrcMethods.UpdateParameters.Add(param);
dsrcMethods.InsertParameters.Add(param);
param = new Parameter("TaxonomicalKeys", TypeCode.String);
dsrcMethods.UpdateParameters.Add(param);
dsrcMethods.InsertParameters.Add(param);
param = new Parameter("TaxonomicalDesc", TypeCode.String);
dsrcMethods.UpdateParameters.Add(param);
dsrcMethods.InsertParameters.Add(param);
gvMethods.DataKeyNames = dataKeys;
gvMethods.DataSourceID = dsrcMethods.ID;
}
protected void Page_Load(object sender, EventArgs e)
{
txtID.Focus();
txtID.Enabled = false;
txtTitle.Enabled = false;
txtAbstract.Enabled = false;
txtJust.Enabled = false;
txtSponsor.Enabled = false;
txtStartDate.Enabled = false;
txtStatus.Enabled = false;
txtEndDate.Enabled = false;
txtProgress.Enabled = false;
txtAck.Enabled = false;
if (!Page.IsPostBack)
{
conn.Open();
try
{
txtID.Text = projectId.ToString();
// Create SqlCommand and Parameter to select ProjectID
cmd = new SqlCommand("Select * from tblProject where ProjectSID=@ProjectID", conn);
cmd.Parameters.Add("@ProjectID", SqlDbType.Int);
cmd.Parameters["@ProjectID"].Value = projectId;

dsProject = new DataSet();
da = new SqlDataAdapter(cmd);
da.Fill(dsProject);
cmd.ExecuteReader();
// If there are no records for the user
if (dsProject.Tables[0].Rows.Count == 0)
{
lbl = new Label();
lbl.Text = "<p>You do not have any data for this Project</p>";
Controls.Add(lbl);
}
else
{
txtTitle.Text = dsProject.Tables[0].Rows[0].ItemArray[1].ToString();
txtAbstract.Text = dsProject.Tables[0].Rows[0].ItemArray[2].ToString();
txtJust.Text = dsProject.Tables[0].Rows[0].ItemArray[3].ToString();
txtSponsor.Text = dsProject.Tables[0].Rows[0].ItemArray[4].ToString();
txtStartDate.Text = dsProject.Tables[0].Rows[0].ItemArray[5].ToString();
txtStatus.Text = dsProject.Tables[0].Rows[0].ItemArray[6].ToString();
if (dsProject.Tables[0].Rows[0].ItemArray[7].ToString() == null ||
dsProject.Tables[0].Rows[0].ItemArray[7].ToString() == "")
txtEndDate.Text = "Not Applicable";
else
txtEndDate.Text = dsProject.Tables[0].Rows[0].ItemArray[7].ToString();
txtProgress.Text = dsProject.Tables[0].Rows[0].ItemArray[8].ToString();
txtAck.Text = dsProject.Tables[0].Rows[0].ItemArray[9].ToString();
}
// Cleanup command and connection objects.
dsProject.Dispose();
da.Dispose();
cmd.Dispose();
conn.Close();
}
catch (Exception ex)
{
// Add error handling here for debugging.
Response.Write(ex.Message);
//System.Diagnostics.Trace.WriteLine("[ValidateUser] Exception " + ex.Message);
}
}
}
protected void mnuProjectDetails_MenuItemClick(Object sender, MenuEventArgs e)
{
gvMethods.Focus();

// Get the MenuItem Clicked
int item = Int32.Parse(e.Item.Value);

if (item == 0)
{
conn.Open();
dsrcMethods.SelectCommand = "select * from tblMethod where ProjectID=" + projectId;
conn.Close();
}
else if (item == 1)
{
conn.Open();
dsrcTools.ConnectionString = conn.ConnectionString;
dsrcTools.SelectCommand = "select * from tblTool t, tblMethod m where m.MethodSID=t.MethodID and"
+ " m.ProjectID=" + projectId;
gvTools.DataSourceID = dsrcTools.ID;
conn.Close();
}
MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value);
}

Thanks for taking your time and I'm positive that you can find something for me.

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.