Hi Rakesh, When you go into edit mode the e.CommandArgument is not working some of the times. Therefore it is likely you cannot find your textbox in that row. I use the following to get the correct row number. GridViewRow row = (GridViewRow)((Control)e.CommandSource).Parent.Parent you can try it and see. regards blooper
Here is some vb.net code I wrote a while back. I had the user press a save button that did a post back and then called this method:
Private Sub closewindow(ByVal indate As Date)
Dim myScript As New StringBuilder
With myScript
.Append("")
.Append(Environment.NewLine)
'This code sets the correct field on the opener form
Dim tmpstr As String = "self.opener.document.forms[0]." + CStr(Session("DatelookupField"))
.Append(tmpstr)
.Append(".value = """)
.Append(indate.ToShortDateString)
.Append("""")
.Append(Environment.NewLine)
'focus the opener form
.Append("self.opener.focus()")
.Append(Environment.NewLine)
'Close the calendar window
.Append("self.close()")
.Append(Environment.NewLine)
.Append("")
Page.RegisterStartupScript("close window", .ToString())
End With
End Sub
All this code is .net 1.1 I set a session variable in the parent form so I knew what the control name was to pass the date back to the parent form. Hope that helps. Ben
type iisreset /h into a command prompt and you'll see all possible commands with (short) explanations.
-^-^-^-^-^- no risk no funk ................... please vote ------>
rockyl wrote:
Are they meant for just logical seperation
It's ASP.NET 2.0 or later architecture.
rockyl wrote:
And if we consider app_code folder which is meant for code files like .cs, .vb etc. What if I place any codefile outside of this folder
If you want to share some classes in whole application, you can keep them inside app_code. Classes inside app_code will be compiled automatically at runtime. ASP.NET treats whole app_code as single assembly.
rockyl wrote:
I placed a .cs file in app_code folder and tried to compile it it was not compiling.
What was the error you are getting ?
My Website | Ask smart questions
I am explicitly selecting the first node tv.SelectedNode = tv.Nodes[0]; and here is my code: private void tv_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 40) //code for down key only { if (currentItemCount > -1 ) { MyItem[currentItemCount].Visible = false; tv.Nodes[currentItemCount].BackColor = Color.White; currentItemCount+= 1; MyItem[currentItemCount].Visible = true; if (tv.SelectedNode != null) { tv.SelectedImageIndex = tv.Nodes[currentItemCount].ImageIndex; } } }
Rakesh
da.TableMappings.Add("EMP", dsTable); The above statement of my code makes a mapping between database table and dataset table, the first parameter is the database table name and the 2nd paramaeter is dataset table name. So I am getting the table name from the dataset and passing to it so that a mapping may occur between the database table and the dataset table. In short I will explain what I am trying to do. Theres an xml file consisting of Employee data, I need to upload this xml content to the Database. For this I have used the Dataset.fill(xmlpath) and then using the dataadapter for updating the data to the database. Now u can see my previous code and get clear understanding.
Rakesh
I have implemented your suggestion, but facing some issues: Below is the code I have used: protected void Button1_Click(object sender, EventArgs e) { string path = @"D:\emp.xml"; string dsTable = ""; string connectionString = @"Server = DB\SQL2; Database = CWBDB; user = sa; password = sa"; DataSet ds = new DataSet("EMPDS"); ds.ReadXml(path); foreach (DataTable t in ds.Tables) { dsTable = t.ToString(); } SqlConnection con = new SqlConnection(connectionString); SqlDataAdapter da = new SqlDataAdapter(); da.TableMappings.Add("EMP", dsTable); if ((da.Update(ds))>0) { Label1.Text = "Uploaded the data successfully"; } else { Label1.Text = "Could not Upload the data"; } } But I see an exception: "Update unable to find TableMapping['Table'] or DataTable 'Table'." Please let me know what needs to be done for this!
Rakesh
*edit* nevermind, looks like others answered your question
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Guess who's having a birthday? (It's not Jesus) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
Yes, that works. Except the name of the method is Dispose, not dispose.
--- It's amazing to see how much work some people will go through just to avoid a little bit of work.