Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

NaveenHS

@NaveenHS
About
Posts
27
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Displaying the image from the Sql
    N NaveenHS

    Displaying the image from the Sql Hi, I am trying to display image on the page stored in the SQL DB. Image is store in the <BinaryData> format in the DB. I am display in the DataGrid its working fine, problem with page.

    SqlCommand Cmd = new SqlCommand(Query, myconnection);
    SqlDataReader dr = Cmd.ExecuteReader();
    if (dr.HasRows)
    {
    dr.Read();
    lblProdName.Text = Product;
    lblProdDesc.Text = dr[0].ToString();
    lblPrice.Text = dr[3].ToString();

          //dr\[5\] image
           byte\[\] Photo = (byte\[\])dr\[5\];
           Response.ContentType = "image/jpeg";
           Response.OutputStream.Write(Photo, 0, Photo.Length); 
          
        }
    
        dr.Close();
    

    only image is displayed on the page without any other content , if I comment lines

    // Response.ContentType = "image/jpeg";
    // Response.OutputStream.Write(Photo, 0, Photo.Length);

    All the contents are displayed except the image. what is the proper way to display the image on the page using SQL ?? Please help me with this. Thanking you, Naveen.

    ASP.NET database help question

  • Book Help
    N NaveenHS

    Thanks a lot Navaneeth.

    C# csharp help question learning

  • Book Help
    N NaveenHS

    Thanks for the response. Is it required to know the .net framework basics before starting with this book? Books are enough or detail coaching class are required ?? or any online video tutor is good enough ? Any good .net training center in Bangalore ?? Please let me know

    C# csharp help question learning

  • Book Help
    N NaveenHS

    Hello Everyone, Which book do u prefer for beginners for starting with C# from scratch OReilly Programming C Sharp 3.0 5th Edition OR OReilly Programming C Sharp 4.0 6th Edition ?

    C# csharp help question learning

  • String Extraction
    N NaveenHS

    Thanks Richard for the response. I tried with IndexOf ,LastIndexOf & str.Substring methods and got the output.

    C# html com question

  • String Extraction
    N NaveenHS

    Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

    C# html com question

  • Excel General Help
    N NaveenHS

    Thanks Peter... I have tried the same ..but i have to do every row at a time ...there are 100 rows its difficult if i select all the rows i get the contents in one row .. :( so any alternate method ? Please let me know ..

    The Lounge help lounge

  • Excel General Help
    N NaveenHS

    It will be mentioned in the Final one ... :omg:

    The Lounge help lounge

  • Excel General Help
    N NaveenHS

    Its of no use ...cant work with 90 deg tilted monitor :) ...

    The Lounge help lounge

  • Excel General Help
    N NaveenHS

    Hi Henry, Thanks ... I did not find any specific forum for general Question so i posted here ... :(

    The Lounge help lounge

  • Excel General Help
    N NaveenHS

    Hello Everyone, I have some Rows of data, like Name 1 Organization 1 Organization 1 Mail Id Name 2 Organization 1 Organization 1 Mail Id Name 3 Organization 1 Organization 1 Mail Id Is there any option to convert all rows to Columns at once ... i tried the Paste Special option but it puts all the 3 rows data to one row i trying with this format in each rows Name 1 Organization 1 Organization 1 Mail Id Name 2 Organization 1 Organization 1 Mail Id Please help me with this .... Thanking you, Naveen HS

    The Lounge help lounge

  • Regex Problem,Extracting text from Table
    N NaveenHS

    Hello Everyone, I am trying to extract the contents of the table from a static HTML file. Program is almost giving the expected output. Program :-

    class Program
    {
    static void Main()
    {
    StreamReader str = new StreamReader("C:\\AllRoles.html");
    string SFile = str.ReadToEnd();

    	    Regex regex = new Regex(
    			@"<tr>(\\s\* <td\[^>\]\*>  \\s\* (?<value>\[^<\]\*?) \\s\* </td> )+ \\s\*</tr>",
    	 		RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
    
    
    		 foreach( Match m in regex.Matches( SFile ) )
    		 {
    			foreach( Capture item in m.Groups\["value"\].Captures ) {
    
    			Console.WriteLine( item.Value );
    		}
    		
    			Console.WriteLine( );
    		}
    			Console.ReadLine();
    	}
    }
    

    I am facing one problem there is a comment in between the table content HTML File :-

    <table border="0" cellpadding="5" cellspacing="0" width="100%">
    <tbody><tr>
    <td class="columnheading" nowrap="nowrap">Last Name</td>
    <td class="columnheading" nowrap="nowrap">First Name</td>
    <td class="columnheading" nowrap="nowrap">Role</td>
    <td class="columnheading">Term</td>
    <td class="columnheading">Company</td>
    </tr>
    <tr>
    <td valign="top">

            <!-- Logic Here-->
            
            
            Gottlieb
            
            </td>
    		<td valign="top">Pradep</td>
    		<td valign="top">President
            
            </td>
    		<td valign="top">8/15/2009 - 9/1/2010</td>
    		<td valign="top">DSCMIT</td>
    
    	    </tr>
    		<tr>
    		<td valign="top">
            <!-- Logic Here-->
            
            
            Rajesh
            
            </td>
    		<td valign="top">H</td>
    		<td valign="top"> President
            
            </td>
    		<td valign="top">8/15/2009 - 8/14/2010</td>
            <td valign="top">BHSIT</td>
    	    </tr>
    

    I am getting the Output as Last Name First Name Role Term Company and it stops at this line <!-- Logic Here--> Can anyone please help me to solve this problem. Thanking you, Naveen HS

    C# regex help html question

  • HTML Table tag text Scraping
    N NaveenHS

    Thanks Luc Pattyn for the response. I corrected the mistakes as follows HTML File :- <html> <body> <table> <tr> <th>Team Name</th> <th>Place</th> </tr> <tr> <td>Kings XI Punjab</td> <td>Punjab</td> </tr> <tr> <td>Chennai Super Kings</td> <td>Chennai</td> </tr> <tr> <td>Deccan Chargers</td> <td>Hydrabad</td> </tr> </table> </body> </html> Program :- static void Main() { StreamReader str = new StreamReader("C:\\Test.html"); string strLings = str.ReadToEnd(); int startIndex = strLings.IndexOf("<table>"); int endInedx = strLings.IndexOf("</table>") + "</table>".Length - startIndex; string strTab = strLings.Substring(1, endInedx); str.Close(); StreamWriter strWr = new StreamWriter("C:\\test2.txt", true); strWr.Write(strTab); strWr.Close(); Console.ReadLine(); } Getting the output as below written to the file .. Not getting the required out put .. :( I will try with Regular Expression now. html> <body> <table> <tr> <th>Team Name</th> <th>Place</th> </tr> <tr> <td>Kings XI Punjab</td> <td>Punjab</td> </tr> <tr> <td>Chennai Super Kings</td> <td>Chennai</td> </tr> <tr> <td>Deccan Chargers</td> <td>Hydrabad</td> </tr

    C# csharp help html css linq

  • HTML Table tag text Scraping
    N NaveenHS

    Hello Everyone, I have one simple static HTML file, with a table i am trying to extract the contents of the table to a file. can anyone please give some some suggestions how to proceed with this work. HTML File:- <html> <body> <table border="1"> <tr> <th>Team Name</th> <th>Place</th> </tr> <tr> <td>Kings XI Punjab</td> <td>Punjab</td> </tr> <tr> <td>Chennai Super Kings</td> <td>Chennai</td> </tr> <tr> <td>Deccan Chargers</td> <td>Hydrabad</td> </tr> </table> </body> </html> I am trying to extract the text with this code :-

    using System.Diagnostics;
    using System.Net;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System;
    using System.IO;
    using System.Linq;

    class Program
    {
    static void Main()
    {
    StreamReader str = new StreamReader("C:\\Sample1.html");
    string strLings = str.ReadToEnd();
    int startIndex = strLings.IndexOf("<table>");
    int endInedx = strLings.IndexOf("</table>") + "</table>".Length - startIndex;
    string strTab = strLings.Substring(startIndex, endInedx);
    str.Close();
    StreamWriter strWr = new StreamWriter("C:\\test2.txt", true);
    strWr.Write(strTab);
    strWr.Close();
    }
    }

    Problem is i am getting an error An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Additional information: StartIndex cannot be less than zero.

    C# csharp help html css linq

  • Logging to Website
    N NaveenHS

    Hi Jinal Desai, Thanks for the response. consider some some website www.somesite.com , that has login id & password, once we login it takes to information page, i am trying to download the content from the information page. so can you please give some suggestions how to start with this work ??

    C# csharp question

  • Logging to Website
    N NaveenHS

    Hello All, I am very much new to C# ... I am trying to log in to website and download some information. is it possible to do that using C# ?? Please suggest me some ideas Thanking you, Naveen HS.

    C# csharp question

  • VC++ & MySQL
    N NaveenHS

    Hello Everyone, Can anyone please suggest me some tutorials and notes for connecting VC++ 8 with MySql ?? I have 2 pc’s here in one pc I have MySql installed & it’s a sever ,... for using MySql in my PC is it required to install SQL in my PC also ? or I can access the tables directly without installing MySql in my PC ? I am very much new to both the things …so asking very silly Questions. :confused: Thanking you, Naveen HS

    C / C++ / MFC c++ database mysql question

  • Win32 to MFC
    N NaveenHS

    Hello Sir, Thank you very much for the response. In the Loop i just added this line , with .GetText method its working now. m_MyListBox.GetText(iIndex, sText);

    C / C++ / MFC c++ help tutorial question

  • Win32 to MFC
    N NaveenHS

    Hello All, I have used the List Control in Win32, same i want to implement in MFC, i am unable to do that can anyone help me with this. Extracting the contents of the list Box in Win 32.

    HWND hList = GetDlgItem(hwnd, IDC_FLIST);
    int count = SendMessage(hList, LB_GETCOUNT, 0, 0);
    for ( int i=0; i < count ; i++ )
    {
    int itemTextLen = SendMessage(hList, LB_GETTEXTLEN, i, 0);
    char *itemText = new char[itemTextLen];
    SendMessage(hList, LB_GETTEXT, i, (LPARAM)itemText);
    }

    MFC:-

    int ListSize;
    ListSize = m_WLinks.GetCount();
    for(int i=0;i<=ListSize;i++)
    {
    }

    In Win32 i had handle so got the control of the list box but how to do that in MFC ? Thanking you, Naveen HS.

    C / C++ / MFC c++ help tutorial question

  • Text from the Html Table tag.
    N NaveenHS

    Hello Everyone, i am trying to Extract the Contents of the HTML page from the Table Tag. Till now i have done with identifying the Table tag from the Html Page. but still i am not able to extract the data from the table tag. can anyone please help me with this. I am getting the output as 0.

    MSHTML::IHTMLDocument2Ptr pDoc;
    MSHTML::IHTMLDocument3Ptr pDoc3;
    MSHTML::IHTMLElementCollectionPtr pCollection;
    MSHTML::IHTMLElementPtr pElement;

    HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,IID_IHTMLDocument2, (void**)&pDoc);

    // psa has the html page contents

    hr = pDoc->write(psa);
    hr = pDoc->close();

    pDoc3 = pDoc;

    pDoc->get_all(&pCollection);
    pCollection = pDoc3->getElementsByTagName("table");

    BSTR itxt;

    for(long i=0; ilength; i++){
    pElement = pCollection->item(i, (long)0);
    if(pElement != NULL){
    m_wndLinksList.AddString((LPCTSTR)bstr_t(pEle->get_innerText(&itxt)));
    }
    }

    C / C++ / MFC html help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups