Sir. I create a project in vb.net 2010 sql server 2008r2 and crystal report 13. i use this code for showing the report. Public Sub PrintSaleRInvoice() Dim PrintSale As New DataSet objsale.saleinvid = txtSaleInvid.Text PrintSale = objsale.PrintSaleInvoice() ' Procedure name PrintSale.Tables(0).TableName = "DataTable1" Dim rpt As New SaleInv rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait rpt.PrintOptions.PaperSource = CrystalDecisions.Shared.PaperSource.Middle rpt.SetDataSource(PrintSale) SaleRInvPrint.CrystalReportViewer1.ReportSource = rpt SaleRInvPrint.ShowDialog() End Sub and it is work fine now i want to pass some value(company name, address, contact, Licence No etc.) cr er004 from global variable which is decalerd on a "global declaration" in a module. i used for CReport dataset cr …

Member Avatar
Member Avatar
+0 forum 1

Hi, i am trying to build Employee Attendance system and was successful in assigning TAGS to employees.now i want to calculate in/out timings of employees and which TAG swapped His/Her TAG without displaying any data to end user. i had tried basic sql query but seems to be not working. Please Help. code i am using for saving and assigning Tags to employees is as follows : SqlConnection con = new SqlConnection(str); con.Open(); SqlCommand cmd = new SqlCommand("insert into EmpTable(TagID,Firstname,Lastname,Title) values (@TagID,@Firstname,@Lastname,@Title)", con); // cmd.Parameters.AddWithValue("@EmpID", txtempid.Text); cmd.Parameters.AddWithValue("@TagID", txttagid.Text); cmd.Parameters.AddWithValue("@Firstname", txtfirstname.Text); cmd.Parameters.AddWithValue("@Lastname", txtlastname.Text); cmd.Parameters.AddWithValue("@Title", txttitle.Text); cmd.ExecuteNonQuery(); MessageBox.Show("Data Saved."); con.Close();

Member Avatar
Member Avatar
+0 forum 1

After you open files (like 7 or 8) on email and download to visual studio, how come it won't let you debug right there? Do I have to save all those files, one at a time and then will it let me debug?

Member Avatar
Member Avatar
+0 forum 1

I've asked this on SO *AND* Reddit without so much as a peep...was hoping DW would turn up the answer! I have an ascx user control that has a custom event added to it. I can get the event to work without problem, but the event doesn't show up in Visual Studio's property editor, only in intellisense. Is there an attribute I am missing or something? The event definition is: [Browsable(true), EditorBrowsable(EditorBrowsableState.Always)] public event EventHandler<EventArgs> SelectedIndexChanged; The event doesn't show up in the property box but all of my custom properties do: ![01.png](/attachments/large/2/d2100029f259ede79e25a6d88645611e.png "align-center") But is accessable through intellisense: ![02.png](/attachments/large/2/1606590fca35bd17c4dff6d7a4ec79ef.png …

Member Avatar
Member Avatar
+0 forum 3

I have many checkboxes on my form, I decided to create a custom checkbox to use instead. I thought I could just change the following two lines of code in Mainform.designer.cs... `private System.Windows.Forms.CheckBox chkapp;` to `private CustCheckBox chkapp;` and `this.chkapp = new System.Windows.Forms.CheckBox();` to `this.chkapp = new CustCheckBox();` And I can, in that the code runs as expected with the additions of the custom check box. But form designer does not like it and will not load, giving just the error "root element missing" If I ignore it and continue, no controls show in form, they are all gone. What …

Member Avatar
Member Avatar
+0 forum 5

I recently lost a job, pretty much because my previous employer expected miracles from an entry level coder. I was tasked with reading years worth of code developed in a sloppy manner (by another coder) in a production environment where I quite literally could not debug without disrupting somebody. There were no test servers implemented. You have probably all realized that it is a lot harder to read code than to write it. (gripe over, now comes the question...) The question is, in C#/Visual Studio how would one debug in a manner which is non-intrusive to the business environment (Remember, …

Member Avatar
Member Avatar
+0 forum 8

Hello I have a VB.NET project (using Visual Studio 2015 Pro) currently found on my PC, and would like to make it shared across my LAN with others so that they can pull a copy on their own PC and work on it, and push their changes to the project, and thus make it available to all devs concerned. Firstly, I would like to move this project to a "central" machine then proceed with the sharing. What is the best way/tool available to share such a project freely on a LAN? What tools would be required for each user to …

Member Avatar
Member Avatar
+0 forum 1

People who know me know that Python has always been one of my favorite languages. And over the years, I've been pleased with the array of development tools that have been created for it, including the different IDEs. I also do a lot of work in .NET, primarily with C#. And although I once wrote a raving review of the .NET implementation of python called IronPython, truth be told, I never use IronPython anymore. Not at all. In the past, oh maybe four years, I've created a grand total of two IronPython programs, each consisting of maybe three lines of …

Member Avatar
Member Avatar
+3 forum 15

Every year or so for the past couple of decades I've seen new products appear that claim to let you create software without having to know how to code. And every time the next one comes out, I roll my eyes, because they always fail to deliver as promised. Usually the concept is the same: You use a tool to design your data, and some other tool to draw out the screens. Then you get a program. The program automatically gets the basic database functionality: A data browser, a data entry form, a search form. But the problem is the …

Member Avatar
Member Avatar
+0 forum 3

I'm a little bit stuck at this moment. As of now, this is the code that I have: private void btnChangeImage_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialogForImgUser = new OpenFileDialog()) { string location = null; string fileName = null; openFileDialogForImgUser.Filter = "Image Files (*.jpg, *.png, *.gif, *.bmp)|*.jpg; *.png; *.gif; *.bmp|All Files (*.*)|*.*"; // filtering only picture file types openFileDialogForImgUser.ShowDialog(); // show the file open dialog box imgUser.Image = new Bitmap(openFileDialogForImgUser.FileName); //showing the image opened in the picturebox location = openFileDialogForImgUser.FileName; fileName = openFileDialogForImgUser.SafeFileName; FileStream fs = new FileStream(location, FileMode.Open, FileAccess.Read); //Creating a filestream to open the image file int …

Member Avatar
Member Avatar
+0 forum 3

How do I detect left mouse button down and up events on the 'Close' option of the system menu that appears when the mouse is clicked on the top left corner of a form?

Member Avatar
Member Avatar
+0 forum 6

Hi all, I found a great VoIP application for WP7 that prevents the service providers to block SIP: http://www.codeproject.com/Articles/722556/How-to-build-a-VoIP-application-for-Windows-Phone. The core of the solution is the following: as it is known, SIP protocol is used in VoIP technology, but its port (5060) is blocked by many mobile service providers. That's why VoIP is blocked on mobile phones. By using this WP7 client application blocking will be impossible, since this application communicates with a server through TCP/UDP and the server communicates with the phone system through SIP. The author of the guide inserted above has used a Windows Phone SDK 7.1 …

Member Avatar
+0 forum 0

MSDN recommends disposing any variable of type System.Drawing.Brush before its last reference is released. Otherwise, the resources it is using will not be freed until the garbage collector calls the Brush object's Finalize method. As we know, local variables are destroyed automatically when the control flow goes out of the scope of the method it belongs. So, is it necessary to dispose a brush object every time if it is local?

Member Avatar
Member Avatar
+0 forum 2

I have an MDI application containing an MdiParent form and few MdiChild forms. The MdiParent has a fixed MenuStrip, a fixed ToolStrip and a fixed StatusStrip. The MdiChild forms have one or more ToolStrips and a StatusStrip along with other controls in them. The ToolStrips and the StatusStrip of the MdiChild are generally hidden and are only shown when the form is opened in the MdiParent. Based on this scenario I have the following objectives: 1) When an MdiChild is opened in the parent, its ToolStrip(s) should be shown along with the fixed Menu and ToolStrip of the parent. Please …

Member Avatar
+0 forum 0

I am creating an app that will allow the user to click on images and then they will transform into something else, and the code to do that is below: private void Image_Tapped(object sender, TappedRoutedEventArgs e) { BitmapImage bitmap = new BitmapImage(new Uri("ms-appx:///Assets/smallImage.png")); imageHolder.Source = bitmap; e.Handled = true; } Now the hard part is that I have to get these pre-transformed images to fly up onto the screen so the user can rush to click on them before they fall. I figured I would need to create storyboards and add those effects, if that is right word for it, …

Member Avatar
Member Avatar
+0 forum 1

A curious thing, is there a reason that you can't declare sender as a specific type? For instance, if you had a number of textboxes and you wanted each one to select all it's text when you click on it could you use : Public Sub TextBox_Click(ByVal sender As TextBox, ByVal e As System.EventArgs) sender.SelectAll() End Sub and add it as the Click Event handler to each textbox. It seems kind of obvious to me, and it does work. But I'm wondering if there is something deep inside visual studio that'll get screwed up.

Member Avatar
Member Avatar
+0 forum 3

Hi I am really new to c#(I used to do vb.net) and I need some help with a problem. I am wondering what the equivalent of a datalist or detailsview in asp.net is in a c# winforms application and how to use it. I have data in a database and I want to retrieve it and display it in a form view when the user clicks a button to search for a record based on a control value as a parameter for the select query. I do not want to use the grid view and anyway Visual Studio 2012 seems …

Member Avatar
Member Avatar
+0 forum 4

I'm newbie in C++ programming and I want to declare a constructor from following code in my main however I'm completely confused about it. Here is the code: #include <vector> using namespace std; template <typename HashedObj> class HashTable { public: explicit HashTable( const HashedObj & notFound, int size = 101 ); HashTable( const HashTable & rhs ) : ITEM_NOT_FOUND( rhs.ITEM_NOT_FOUND ), array( rhs.array ), currentSize( rhs.currentSize ) { } const HashedObj & find( const HashedObj & x ) const; void makeEmpty( ); void insert( const HashedObj & x ); void remove( const HashedObj & x ); const HashTable & operator=( …

Member Avatar
Member Avatar
+0 forum 1

I built a ClassLibrary where I have created my custom form component (let's say MyForm) that inherits from the Form class. I added the ClassLibrary to my actual WinForms project. Now when I add an inherited form based on MyForm to my project through the 'Add New Item' dialog box for the first time, its Text property remains blank by default. But when you add a standard form to a project, its Text is set to its Name by default. This is what my requirement is. I even tried to set the Text property in MyForm's constructor, yet it isn't …

Member Avatar
Member Avatar
+0 forum 3

Ensure ApplyVisualStyles is enabled in your system. Place a ToolStripProgressBar on a toolstrip, run your application and minimize the form. Now change the theme of your computer to Windows Classic and restore the form. See the interior of the ToolStripProgrssBar becomes black. It doesn't even change if you refresh the form. How does the user know the status of the progress if it remains black always? Any approach to fugure it out? Regards.

Member Avatar
Member Avatar
+0 forum 1

I am rendering a toolstrip with a CustomRenderer that inherits from ToolStripProfessionalRenderer. The concept is that I want the color of the arrow of the toolstrip items to be white in all cases except selection. When it is selected the color should be black. In my code below all arrows are painted accordingly except the ToolStripComboBox where the color of the arrow always remains the same; the default one. How to sort it out? Hope I don't need to write the whole class but only the relevant fragment. So I uploaded the OnRenderArrow method only. Friend Class CustomRenderer Inherits ToolStripProfessionalRenderer …

Member Avatar
Member Avatar
+0 forum 1

I am trying to compile NeHe code for win32 app in visual studio 2010. but this error appear: [CODE]cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast[/CODE] to these instructions [ICODE] if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts? { MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); }[/ICODE] can you help me plz.

Member Avatar
Member Avatar
+0 forum 2

I am getting an access violation. Can anyone see why this might occur in the following code fragment from a GUID generator? [CODE] // here is a code fragment fro a GUID creation routine. // it is crashing with an Access violation #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <stdlib.h> #include <time.h> using namespace std; char* guidStr = "{00000000-0000-0000-0000-000000000000}"; void GenerateGuid() { char *pGuidStr = guidStr; int i; srand(static_cast<unsigned int> (time(NULL))); /*Randomize based on time.*/ /*Data1 - 8 characters.*/ system("PAUSE"); // code gets to here okay *pGuidStr++ = '{'; // <code crashes here // Code Crashes when it …

Member Avatar
Member Avatar
+0 forum 3

I wrote a recursive function using System.IO stuff in order to copy a directory and all its contents to another location. I'm using Windows 7 and Visual C# 2010. It looked like a simple task but it really isn't. First, when i tried to run the code i got a permission error. Much research told me that to fix this i had to change the manifest to request better permissions, so i set it to ask for highestAvailable thinking this would surely work. I was wrong. Next I got an error about my program being a clickonce application that shouldn't …

Member Avatar
Member Avatar
+0 forum 5

I am getting errors on installing Visual Studio 2008 on Windows 7 machine. On digging down deeper I found that "Microsoft Visual Studio Web Authoring Component" is not getting installed which is a pre-req for VS 2008. I further drilled down and searched different forums over the internet, they mostly pointed out towards installation of "WebDesignerCore.exe" which is located at the following location in Visual studio setup directory: \MS VS 2008\WCU\WebDesignerCore\WebDesignerCore.exe It is stopping while extracting Autorun.inf(the error snapshot is attached) I then tried creating a dummy file with the name Autorun.inf. When I attempted to open it, it gave …

Member Avatar
Member Avatar
+0 forum 2

Me and my team are working with arduino devices for a project and we need a way to talk and respond from arduino to visual studios. any coding out there to work on this because i can not seem to find any myself

Member Avatar
+0 forum 0

The problem is in lies in TA.Insert(txtfirst.text) I really dont know what is parameter,,,,all about pls help me...pls [CODE] Public Class AddOutPatient Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub Private Sub btnaddout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaddout.Click 'validation for firstname If txtfirst.Text.Trim = "" Then MsgBox("You should enter your firstname", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly) txtfirst.Focus() Exit Sub End If If txtfirst.Text.Contains(".") Then MsgBox("The name should include letters only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly) txtfirst.Focus() Exit Sub End If 'validation for lastname If txtlast.Text.Trim = "" Then MsgBox("You should enter …

Member Avatar
Member Avatar
+0 forum 4

How can I detect the click event of the close (X) button at the top right corner of the control box of a form/window? Please note, I don't want to know about CloseReason, FormClosing, FormClosed or stuffs like these, unless they are inevitable. I exactly want to detect if the user clicked the X button of the form. Thanks.

Member Avatar
Member Avatar
+0 forum 3

I am using Entity Framework in Visual Studio linked to a back end database and would like to change the column name of the tables. Currently they have underscores which I want to remove, although there are many tables and columns. Is there an easy way to do this? I tried to edit properties on the DBML file but this did not work. Thanks in advance.

Member Avatar
+0 forum 0

I'm trying to find a way to display the favicon from the webBrowser in Visual Studio Windows Forms to a pictureBox. Can anyone help out?

Member Avatar
+0 forum 0

The End.