Jump to content
Xtreme .Net Talk

burak

Avatar/Signature
  • Posts

    143
  • Joined

  • Last visited

burak's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, In my gridview, I have two BoundField columns and a templatefield column as follows <asp:GridView> <Columns> <asp:BoundField DataField="ams" HeaderText="Ams" ReadOnly="True"/> <asp:BoundField DataField="ams_desc" HeaderText="Desc" ReadOnly="True"/> <asp:TemplateField HeaderText="AmsTest" ItemStyle-Wrap="true" HeaderStyle-Width="120"> <ItemTemplate> <asp:TextBox ID="txtStudents" Text='<%# Eval("val") %>' AutoPostBack="true" OnTextChanged="HandleTextChange" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:SQLDataSource ID="sqlProducts" Runat="Server" SelectCommand = "SELECT ams, ams_desc From audit_ams" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"> </asp:SQLDataSource> when a user changes the value in the textbox and presses enter, I call this event and change the values in the first two columns Public Sub HandleTextChange(ByVal sender As Object, ByVal e As System.EventArgs) Dim x As TextBox x = CType(sender, TextBox) Dim y As System.Web.UI.WebControls.DataControlFieldCell y = CType(x.Parent, System.Web.UI.WebControls.DataControlFieldCell) Dim z As System.Web.UI.WebControls.GridViewRow z = CType(y.Parent, System.Web.UI.WebControls.GridViewRow z.cells(0).text = "some value" -> changes the first boundfield column z.cells(1).text = "other value" -> changes the second boundfield column End Sub but when I move to a different page, I lose the values, since the change was not made to the underlying datatable. I tried to get the underlying datarow as follows Dim f As DataRow f = CType(z.DataItem, Data.DataRow) but nothing happened. How can I change the underlying datarow for this GridViewRow? Thanks, Burak
  2. Hello, I found the code to export contents of a gridview to excel on a webpage: Sub doExcel(Source as Object, E as EventArgs) If Grid1.Rows.Count.ToString + 1 < 65536 Then Grid1.AllowPaging = "False" Grid1.DataBind() Dim tw As New StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) Dim frm As HtmlForm = New HtmlForm() Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "attachment;filename=Test.xls") 'Response.AddHeader("content-disposition", "attachment;filename=" & txtFile.text & ".xls") Response.Charset = "" EnableViewState = False Controls.Add(frm) frm.Controls.Add(Grid1) frm.RenderControl(hw) Response.Write(tw.ToString()) Response.End() Grid1.AllowPaging = "True" Grid1.DataBind() Else LblError.Text = "Too many rows - Export to Excel not possible" End If End Sub this code works but the problem is I don't understand how it works. I don't understand why we need to create a new form and add controls to it, how the data gets copied from the gridview to the excel file etc.. Could someone explain this code to me please? Thank you, Burak
  3. Hello and Happy Thanksgiving, I am dynamically creating a label and assigning a width to it. Dim lbl3 As New Label lbl3.Text = name lbl3.Width = System.Web.UI.WebControls.Unit.Point(255) This shows up as <span style="width:255pt;"> when I do a viewsource. IE displays the width fine but Netscape 7.1 does not preserve the width of the span. I copied the <browsercaps> xml in the following page http://slingfive.com/pages/code/browserCaps/ into my web.config but it didn't solve my problem. Do you know how can I get nescape to display the width properly? Thank you, Burak
  4. Hello, I would like to dynamically create a radio button by assigning this string to a label or a literal <input type="radio" name="AJB" value="YES" onClick="javascript:toggle('YES','radGrantAllPermissions');" runat="server" id="Radio1"> How would I then access this control on the server side? Thank you, Burak
  5. Hello, I have a .net web service that gets called from a cold fusion client. When I return a string or integer (simple types) from the web service, everythng works fine but when I try to return a class, I get an error message saying the web service could not be found. Has anyone else encountered this before? Thank you, Burak
  6. Hello, I have an oracle stored procedue that returns a cursor PROCEDURE GetNumTitleUniqueFamilies ( word in varchar, src in varchar,onetfam in varchar, wordrows out types.word_cursor_type) as begin open wordrows for select distinct substr(ONETCODE, 1, 2) from PROCESSEDWORDS where WORD = word and SOURCE = src and ( TITLEMAXOCCURENCE is not null and TITLEMAXOCCURENCE > 0 ) and substr(ONETCODE,1,2) != onetfam; end GetNumTitleUniqueFamilies; I found a page that shows how to call a stored procedure that returns a cursor http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B308073 but I was wondering how I would add an output parameter if I want to call it in the following manner strSelect = "GetNumTitleUniqueFamilies" cmdselect = New OleDbCommand(strSelect, objConnSkills2) cmdselect.CommandType = CommandType.StoredProcedure cmdselect.Parameters.Add("word", OleDbType.VarChar).Value = strWord cmdselect.Parameters("word").Direction = ParameterDirection.Input cmdselect.Parameters.Add("src", OleDbType.VarChar).Value = strSource cmdselect.Parameters("src").Direction = ParameterDirection.Input cmdselect.Parameters.Add("onetfam", OleDbType.VarChar).Value = strOnetFamily cmdselect.Parameters("onetfam").Direction = ParameterDirection.Input since there is no OleDbType.Cursor type. Thank you, Burak
  7. Hello, I am working on a VB.NET web service that will be used to send and receive job openings. I would like to use their "industry standard" xsd file http://ns.hr-xml.org/2_2/HR-XML-2_2/StandAlone/PositionOpening.xsd which specifies the formatting for job openings. I cleaned up the xsd file and ran xsd.exe on it and it produced an incomplete class file. So I then ran "XSDObjectGen" on it ( http://www.microsoft.com/downloads/details.aspx?familyid=de0cc46b-4dea-4786-9eb0\ -8733e41bf5a8&displaylang=en ) and this also produced an incomplete class file that won't compile. Is there any tool that takes an xsd file and produces vb classes from it, without any glitches? Thank you, Burak
  8. Hello, I am working on a VB.NET web service that will be used to send and receive job openings. I found a site called "hr-xml consortium" "The HR-XML Consortium is an independent, non-profit organization dedicated to the development and promotion of a standard suite of XML specifications to enable e-business and the automation of human resources-related data exchanges." I would like to use their xsd file http://ns.hr-xml.org/2_2/HR-XML-2_2/SEP/PositionOpening.xsd which specifies the formatting for job openings. This xsd file makes use of other xsd files on the site. How can I generate classes from this xsd file in vb.net? Once they are generated, I would then fill them with data and then send them to the client. Thank you, Burak
  9. Hello, I know of two main ways by which structured information is sent : - web services - sending a flat file Is there any other way, possibly tcp-ip based, to send structured information? Thank you, Burak
  10. Hello, I am working on a web service that will send and receive job listings. I already came up with variable names for my jobs class but I was wondering if there is any standard interface definition for naming job class variables in a web service? Thank you, Burak
  11. Hello, I would like to format the string "11304200" into "11-3042.00". Can I do this with String.Format method? Thank you, Burak
  12. Hello, Is it possible to join two tables on two separate oracle databases? I would like to have two connections to two databases and execute a query joining two tables in each db. Dim connString1 As String = "Data Source=ds1;etc.." Dim connString2 As String = "Data Source=ds2;etc.." Dim conn As New System.Data.OracleClient.OracleConnection(connString1) Dim conn2 As New System.Data.OracleClient.OracleConnection(connString2) Is this possible? Thanks, Burak
  13. Hello, Do you know of any root word dictionary dll or com component that can be plugged into a .net app? I would like to pass in a word to this component and it would return the root of this word ex: If i pass in "programmers" it would return "programmer", not program. Thank you, Burak
  14. Hello, I am using a textbox in multiline format <asp:TextBox id="txtJobDesc" Runat="server" MaxLength="2000" Width="255" Height="115" TextMode="MultiLine"></asp:TextBox> this shows up fine on IE but it just shows up as <textarea name="txtJobDesc" id="txtJobDesc"> on netscape, without any width or height settings. I tried to solve this problem by assigning the width and the height in the code behind as follows txtJobDesc.Height = Unit.Pixel(115) txtJobDesc.Width = Unit.Pixel(255) but even this didn't solve the problem. How can I fix this so that it shows up fine on Netscape? Thank you, Burak
  15. Hello, I will be working on a .net project that will use the words entered by the user to return related jobs. The program will have to look at job titles and job descriptions to determine if a job is related to the keywords. Do you know any text matching software that does this? Thank you, Burak
×
×
  • Create New...