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
P

Puneet Bhatnagar

@Puneet Bhatnagar
About
Posts
19
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar
    P Puneet Bhatnagar

    Hi, I am working on a website and on the home page we have a pdf file link. The moment user clicks on that link the control takes the user to new URL, also displays the URL in the Address line of Browser, where the PDF file exists. However I don't want to show this URL to user, so that he can't copy and paste that URL in another browser. Is there any way possible to hide such details or is it possible to just download the pdf without showing the URL (one where PDF file actually exists) in the address line of the browser. If user is able to download also it is fine. The only thing we need is to hide the URL. Thanks in Advance!!

    C#

  • how to write a script which canrun my dot net exe at regular interval
    P Puneet Bhatnagar

    Hi, i want to write a script which can run my dot net exe at regular interval, without manual intervention. Please help me as I am very new to this kind of work. Is it possible to write such a program in dot net itself? I am using the following: Platform: Windows XP framework: .net 2005, language: C# back end - Sql Server 2005. Thanks in Advance for your help!! With Regards Puneet

    C# csharp database sql-server sysadmin tools

  • Office Interop Exception in VB.NET1.1, Please help
    P Puneet Bhatnagar

    Hi, I am using VB.NET1.1 and office 2003. I have created a object of Word document, opening it, writing some data into the document Printing it and finally closing the document. However it is throwing this exception while closing the document. exception from hresult 0x800A140C Here is the code piece: If (IsNothing(appWord) = True) Then appWord = ModWord.GetWordApplication End If docProposal = ModWord.GetDocument(appWord, lstrFileName) lstrFileName = docProposal.FullName lstrFile = docProposal.Name If (docProposal.MailMerge.Fields.Count > 0) Then For Each bk As Word.MailMergeField In docProposal.MailMerge.Fields bk.Locked = True Next ' Create a data source containing the field data. docProposal.MailMerge.CreateDataSource(Name:=lstrDataFile, HeaderRecord:="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37") ' Open the file to insert data. 'docProposalData = appWord.Documents.Add(lstrDataFile, Visible:=False) docProposalData = appWord.Documents.Open(lstrDataFile, Visible:=False) With docProposalData.Tables.Item(1) lint = 1 For Each lstr In laHdg .Cell(1, lint).Range.Text = lstr lint += 1 Next lint = 1 For Each lstr In laData .Cell(2, lint).Range.Text = lstr lint += 1 Next End With ' Save and close the data file. docProposalData.SaveAs(lstrDataFile) Application.DoEvents() 'The code is breaking at this line. docProposalData.Close(Word.WdSaveOptions.wdDoNotSaveChanges, , False) Application.DoEvents() Please help For Reference here is GetDocument function Public Shared Function GetDocument(ByVal wordApplication As Word.Application, ByVal filename As String) As Word.Document If wordApplication Is Nothing Then Throw New ApplicationException("Word application is nothing.") End If Dim docProposal As Word.Document = wordApplication.Documents.Open(filename) If filename.EndsWith(".dot") Then For Each templ

    Visual Basic csharp com help

  • How to call a code behind function from a .aspx file
    P Puneet Bhatnagar

    Hi, Please let me know how to call a function written in Code Behind file, in a different folder, from a .aspx control. Here is what I am doing: <img src = "<%=DAL.CommonUtil.GetConfigValue("ImagePath")%>/header_bg.jpg" alt ="headerImage" /> DAL - FolderName CommonUtil - Class GetConfigValue - Function. Error Message - The name DAL does not exist in current context DAL folder is under App_Code folder. I tried appending App_Code in my src string, however I am   still etting the error Error Message - The name App_Code   does not exist in current context. I really appreciate the help and would like to thank you in advance. Thanks & Regards Puneet

    ASP.NET help tutorial

  • Copy data from MS Access tables to an XML file using C#
    P Puneet Bhatnagar

    Hi, Hi,We are migrating our DB from MS Access to SqlServer 2005. So could anybody please let me know how to copy the data in MS Access tables, first to an XML file and then to a table in Sql Server 2005, using C# as programming language and .NET 2005 as platform. Thanks & Regards Puneet

    Database csharp database sql-server sysadmin xml

  • Migrating My Access DB into Sql Server
    P Puneet Bhatnagar

    Hi, We are migrating from MS Access to SqlServer 2005. Could anyone please let me know how to copy tables and other objects (Stored procedures, triggers) from our current Access Database to SqlServer 2005. Thanks & Regards Puneet

    Database database sql-server sysadmin tutorial

  • How to Add Two Different Strings to same Index In a Combobox - .NET1.1
    P Puneet Bhatnagar

    Thanks for your efforts and time. I tried with your code and it is working fine, Combo box is displaying only the FirstString. However to retrieve records from combobox I have writen this code Private Sub CboProject_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CboProject.SelectedIndexChanged GetProjectID(Me.CboProject.SelectedIndex) End Sub Public Sub GetProjectID(ByVal iIndex As Int32) Dim d1 As TheData = New TheData d1 = Me.CboProject.Items.Item(iIndex) RichTextBox1.Text = d1.SecondString.ToString() RichTextBox1.Text = RichTextBox1.Text & " " & d1.FirstString.ToString() End Sub Problem Description : Irrespective of the iIndex value FirstString and SecondString always are returnig the last record.

    Visual Basic tutorial csharp database

  • How to Add Two Different Strings to same Index In a Combobox - .NET1.1
    P Puneet Bhatnagar

    "Could Not Bind To The New Display Member, Parameter Name: New Display Member"

    Visual Basic tutorial csharp database

  • How to Add Two Different Strings to same Index In a Combobox - .NET1.1
    P Puneet Bhatnagar

    Hi, I tried with all your suggestions however it is still not working. Please let me know what shall I do? Thanks & regards Puneet

    Visual Basic tutorial csharp database

  • How to Add Two Different Strings to same Index In a Combobox - .NET1.1
    P Puneet Bhatnagar

    Hi, Thanks for your help and time. However still I am facing some problem. Please find below my code. Try Dim sql As String Dim DB2conn As DB2Connection Dim ds As New DataSet DB2conn = New DB2Connection("server=" & ServerAddress & ";database= " & sDBName & ";Connect Timeout=30;user Id=" & UName & ";password =" & pwd &) Dim DB2Cmd As New DB2Command sql = "Select * from ProjectMaster" DB2conn.Open() Dim DB2DA As New DB2DataAdapter(sql, DB2conn) DB2Cmd = New DB2Command(sql, DB2conn, DB2trans) DB2DA.Fill(ds) ComboBox2.DataSource = ds.Tables(0) ComboBox2.DisplayMember = "ProjectMaster.ReleaseNumber" Me.ComboBox2.ValueMember = "ProjectMaster.ProjectID" Catch ex As Exception MessageBox.Show(ex.Message + " " + ex.Source) Finally DB2conn.Close() End Try The code is breaking at line (ComboBox2.ValueMember = "ProjectMaster.ProjectID"), in bold in code snippet. Please let me know where I am going wrong. Again Thanks for your efforts.

    Visual Basic tutorial csharp database

  • How to Add Two Different Strings to same Index In a Combobox - .NET1.1
    P Puneet Bhatnagar

    Please let me know the property with which I can accomplish the above mentioned task. For more clearity here is an example: Suppose I have a combobox with name- cboProject and my Two strings are - Puneet, India DesiredTask: I want to add both these strings to 0th Index of cboProject and at the same point of time hide the text followed by "," i.e hide India. Thanks & Regards Puneet

    Visual Basic tutorial csharp database

  • PLZ HELP!!!Not able to Delete the records from DB using NHibernate
    P Puneet Bhatnagar

    Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : I have checked my DB too and it has records. public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet

    C# help database tutorial

  • Reflection- trying to use reflection in my project, with the code given on codeproject.com itself, however it is not working.. Plz help!!
    P Puneet Bhatnagar

    Hi, Thanks a lot sir. I will try your solution and will definately read some more stuff on Reflection and Generics. Once again thanks for your efforts and time. Regards, Puneet

    C# help com

  • Reflection- trying to use reflection in my project, with the code given on codeproject.com itself, however it is not working.. Plz help!!
    P Puneet Bhatnagar

    Hi, Thanks for the way3. I have already tried with that and that was working fine for me. The reason why I am using Reflection and Generics is because we gonna use these two concepts in our next project which still is in design phase. So just to learn I am using them. Thanks for your efforts. Thanks & Regards, Puneet

    C# help com

  • Reflection- trying to use reflection in my project, with the code given on codeproject.com itself, however it is not working.. Plz help!!
    P Puneet Bhatnagar

    Here is the code snippet, with Reflection code. I have taken the code for Reflection from below link "http://www.codeproject.com/KB/cs/C\_\_Reflection\_Tutorial.aspx" public bool SaveLoginInfo(string UserName, string Password) { if (objForDBTransactions == null) { objForDBTransactions = new RegMgr(); } try { bool bSaveDone = false; object[] ArrayParam = new object[] { UserName, Password, objForDBTransactions }; //=================================================================================================== //Way 1: It is throwing an error - Object reference not set to the instance of the object //Type Objtype = Type.GetType("Login"); //MethodInfo myMethodInfo = Objtype.GetMethod("Save"); //myMethodInfo.Invoke(Objtype, ArrayParam); //=================================================================================== //Way 2: It is throwing an error - AddressBook.Login.Save does not exist Type ObjType = typeof(Login); Object obj = Activator.CreateInstance(ObjType); bSaveDone = (bool)ObjType.InvokeMember("Save ", BindingFlags.InvokeMethod, null, obj, ArrayParam); // Tried with Save, Save, Save however none is working. //=================================================================================================== return bSaveDone; } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.Source); return false; } } Here is Save function of Login class public bool Save (T UserName, T Password, RegMgr objRegmgr) { this.UserName = UserName.ToString(); this.Password = Password.ToString(); objRegmgr.SaveLoginInfo(this); return true; } Thanks in Advance

    C# help com

  • NHibernate
    P Puneet Bhatnagar

    Ya Record is there. Could you please let me know where I am going wrong. Thanks for your efforts.

    C# help database tutorial

  • NHibernate
    P Puneet Bhatnagar

    Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet

    C# help database tutorial

  • Print the information on a Windows Form
    P Puneet Bhatnagar

    Hi, How to print the entire information on a windows form. I am using MS- .NET 2005 Thanks In Advance Regards, Puneet

    C# csharp tutorial

  • NHibernate
    P Puneet Bhatnagar

    Hi I am using nHibeernate version 1.0.4., which I took from SourceForge.Net with the configuration settings given in the site itself. I am getting the follwing error in Mapping a file. Error Could not find a getter for property 'UN' in class 'Address.Info' A first chance exception of type 'System.NullReferenceException' occurred in Address.exe Please find below my code files: PLease replace &lt; with '<' and &gt; with '>'. class Info { private int id; private string UN; private string PN; } My mapping File with name Info.hbm.xml: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name ="Address.Info, Address" table ="Info"> <id name ="Id" column="LoginID" type ="Int32" unsaved-value ="0"> <generator class="native" /> </id> <property name="UN" column="UN" type="String(50)" /> <property name="PN" column="PN" type="String(50)" /> </class> </hibernate-mapping> Could you please tell me what I need to do to reslove this issue?? Thanks in Advance With Regards, Puneet

    C# help csharp c++ java xml
  • Login

  • Don't have an account? Register

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