Topics
-
- 0 replies
- 675 views
I've been wondering this for a while, might as well pose the question here. I have interface A and class B defined as: public interface A { string Name { get; set; } string Desc { get; set; } } public class B: A { private string m_Name; private string m_Desc; string A.Name { get { return m_Name; } set { m_Name = value; } } string A.Desc { get { return m_Desc; } set { m_Desc = value; } } } [/Code] I want to data-bind an array (or list, doesn't matter) of Class B to a datagrid. How do I do it?
Last reply by Diesel, -
-
- Administrators
- 1 reply
- 1.5k views
1. XMLWriterTraceListener 2. TextWriterTraceListener 3. DefaultWriterTraceListener Ok, I am going through the MCTS book for exam 70-536, I am currently looking at chapter 10, lesson 2 "Debugging and Tracing". The lesson talks about using Trace listeners and how they can be implemented using either code or in the .config file. I have a basic web application, so I have tried to implement the XMLWriterTraceListener in my web.config. I would intend to try out the other 2 listeners also. Now, to apply the changes to the config file only, the following changes need to be made: <system.diagnostics> <trace autoflush="true" indentsize="5"> <listeners&g…
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 1 reply
- 1.3k views
I get an exception while saving a excel into the location.. Source code : private void CreateExcelWorkbook(string strsql) { string strCurrentDir = Server.MapPath(".") + "\\"; RemoveFiles(strCurrentDir); Excel.Application oXL; Excel._Workbook oWB; Excel._Worksheet oSheet; Excel.Range oRng; try { GC.Collect();// clean up any other excel guys hangin' around... oXL = new Excel.Application(); oXL.Visible = false; //Get a new workbook. oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value)); oSheet = (Excel._Worksheet)oWB…
Last reply by PlausiblyDamp, -
-
- 0 replies
- 2k views
SET IDENTITY_INSERT ON in Access So in SQL Server I could allow insert data in the identity field with SET IDENTITY_INSERT tablename ON Is there an identical way to do this in Access? thx Edit: Detected some Errors
Last reply by rfazendeiro, -
- 2 replies
- 981 views
Hey Guys, I have beeen working on a program for my sisters company for some time now, but recently had a break from it. I am now back on track with it though finally! :) I am stuck on how to search the database for records containing a word the user specifies. At the moment i have got the code sql = "SELECT * FROM tblclient" & txtsurname.Text '' WILL NOT EARCH FOR SPECIFIED TEXT!!!! da = New OleDb.OleDbDataAdapter(sql, con) da.Fill(ds, "Eclypse Live") maxrows = ds.Tables("Eclypse Live").Rows.Count lbltotallresults.Text = maxrows & " clients found." inc = inc + 1 lnkresult1.Text = ds.Tables("Eclypse Live").Rows(i…
Last reply by bluejaguar456, -
-
- Administrators
- 6 replies
- 2.8k views
Maybe this is a silly question, but I can't seem to find the answer. How can I use WPF Databinding (Datacontext) to bind to an existing business object? I have seen plenty of examples that impliment INotifyPropertyChanged, how can I databind if I cannot change these objects to impliment this interface? TIA
Last reply by Nate Bross, -
-
-
- Administrators
- 1 reply
- 703 views
Private ReportLog As StringBuilder Private Sub DoThat() 'We didn't assign any value to the ReportLog so here we want to check if it's empty or not? If ReportLog IsNot Nothing And ReportLog.Length > 0 Then ' End IF End Sub The problem is that "If ReportLog IsNot Nothing And ReportLog.Length > 0 Then" itself throws an exception! A first chance exception of type 'System.NullReferenceException' occurred in MyApp.exe A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll How should I check that variable? Thank you :)
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 2 replies
- 2.1k views
hai, i am generating check boxes dynamically (code is given below) i wanted to capture the check box checked status plz help me how to do this, dont consider that i have given both text property and ID are same as this i am testing i have given this CheckBox chk; chk = new CheckBox; DateTime dt = DateAndTime.DateAdd(DateInterval.Day, 1, date1); String str = dt.ToString("D"); String[] abc = str.Split(new Char[] { ',' }); Panel1.Controls.Add(chk); chk.ID=abc[0]; chk.Text=abc[0]; chk.Width=150; chk.Height=50; If Possible give me sample example
Last reply by JohnsHandle, -
-
-
- Administrators
- 4 replies
- 781 views
Just wondering which (if any) might be better? Since there are at least 4 ways to build a string that I can think of off the top of my head. Simple String Building int val = 2112; string myString = "SomeValue " + val.ToString(); [/Code] string.Format (what I prefer for readability, especially with bigger string construction) [Code] int val = 2112; string myString = string.Format("SomeValue {0}", val); [/Code] or StringBuilder? or string.Concat(string, string...) or some other method I can't think of at the moment. I can think of possibly valid times when I might want to use anyone method over anouther but thought I would let the experts weigh in. …
Last reply by Nate Bross, -
-
-
- Administrators
- 8 replies
- 1.7k views
I am about to be developing a solution in which I rely on several outside (out of my control) web services (both WCF and ASMX). Each individual service provides multiple methods and business objects that relate to said service. Each service also has a test/dev endpoint, as well as a production endpoint: test.service.com and production.service.com. This is sort of a two-parter: First, am I correct in that all I should have to do is swap the endpoint address from the app.config file when I am ready to go from test to production? (Assuming that I am able to get a valid token for production access?) Second, my application will be relying heavily on these services, b…
Last reply by Nate Bross, -
-
-
- Leaders
- 5 replies
- 8.9k views
Hello, How do I setup my forms so I can use that 'CenterParent' option for forms? I have a mainform and a bunch of smaller forms that I want to popup in the middle of the main form no matter where it is on the screen. Any help is greatly appreciated! I currently have my mainform's IsMDIContainer set to true. Dim MyForm As New SmallForm() MyForm.StartPosition = FormStartPosition.CenterParent MyForm.ShowDialog() Unfortunately, this doesnt work. Best regards, VB Newbie
Last reply by benpaul, -
-
-
- Administrators
- 4 replies
- 1.4k views
Hi eveyone. I would like to read a binary file: Windows Address Book. However, since I JUST want to import email addresses from WAB to my application I think I can open and read it myself. If you see my snapshot, email addresses are human readable and just with spaces, not encoded! So I think this command will open file file well: Dim ReadText As Byte() = System.IO.File.ReadAllBytes("C:\Documents and Settings\Username\Application Data\Microsoft\Address Book\Username.wab") The only problem is that I never tried to read binary files. And don't know how to process this Byte variable: ReadText! Do you have any idea how can I just extract email addresses? I even ha…
Last reply by Nate Bross, -
-
- 3 replies
- 1.8k views
Hi everyone, How can I detect if my current OS which my program is running under, is Windows Vista? Please note that there are 2 versions of Vista: Vista and Vista SP1. The build number of Vista SP1 is the same as Windows Server 2008 and that makes the problem! I just want to make sure my OS is vista?! Please help me :) Thanks all...
Last reply by Diesel, -
- 1 reply
- 799 views
How do you people get this special folder? D:\Users\My User Name\ I tried to get all special folders but was not able to get this one in Vista! :( IS that possible or I cannot find it? Thanks.
Last reply by Diesel, -
- 1 reply
- 3.9k views
I'm trying to use a 32 bit dll in a 64 bit environment. The vendor of the dll told me that I should make the following setting change: Platform Target = x86 instead of Any CPU On another source I read that: For VB.net projects, the setting is found on the Advanced Compiler Settings dialog which is made available via the Advanced Compile Options button on the Compile tab of the Project Properties. The list of available options are: 1. Any CPU 2. x86 3. x64 4. Itanium ...but I can not find such a setting. Is this setting forced to Any CPU on the Express version of VB 2008? Do I have any other workarounds to be able to use the 32 bit dll?
Last reply by Nate Bross, -
Hi, I want to convert this VB6 code to VB.NET: Private Function StripNullChars(ByVal MyString As String) As String Do While Len(MyString) > 0 If Asc(VB.Right(MyString, 1)) <> 0 Then Exit Do MyString = VB.Left(MyString, Len(MyString) - 1) Loop StripNullChars = MyString End Function However, I don't know what are replacements .NET version of VB.Left and VB.Right? Please help me. Thanks.
Last reply by PlausiblyDamp, -
- 0 replies
- 1.9k views
Hi, I have one panel, on that there is one picturebox. Here I m providing my sample code, in this it is not printing the transparent rich textboxes. Form has 1 printpreviewDialog and 1 printpreviewdocument. Public Class Print Private Sub Print_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim img As Image img = Image.FromFile("c:\sunset.jpg") Dim bm As New Bitmap(img, Panel1.Width, Panel1.Height + 50) PictureBox1.Image = bm PictureBox1.Height = PictureBox1.Image.Height PictureBox1.Width = PictureBox1.Image.Width PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage …
Last reply by Mansi Shah, -
- 2 replies
- 5.2k views
I wrote a program that does a variety of different things, one of them being that it creates dynamic reports using Crystal Reports. Everything works fine and dandy when I execute the file on my machine, but when I try it on different machines everything works just fine except for the reports. They won't open at all. Are there specific files that I need to include in the same directory as the executable? I tried including the .rpt and .dll files associated with the reports but still didn't have any luck. Any advice?
Last reply by robertsams23, -
- 1 reply
- 2.3k views
Hi All, I have the following code.... private void button2_Click(object sender, EventArgs e) { decimal myAmount = System.Convert.ToDecimal(this.amountTextBox.Text); decimal myVat = System.Convert.ToDecimal(this.vatTextBox.Text); int mySupplier = System.Convert.ToInt32(this.supplierComboBox.SelectedValue); string myDescription = this.descriptionTextBox.Text; DateTime myDateAdded = DateTime.Parse(this.dateaddedDateTimePicker.Text); int myEventID = iPromote.eventID; int mySupplierID = System.Convert.ToInt32(this.supplierComboBox.SelectedValue); try { …
Last reply by benpaul, -
-
- Administrators
- 1 reply
- 4.7k views
Hi All, Sorry, I have checked as many forums as I can and also googled etc, but to be honest I dont really know what im looking for! My problem is this... I have an application, when it first starts it displays a windows form that has a combobox populated with a list of 'events' that the user has created... this is working correctly... the user selects the 'event' that they want to administrate and this sets a variable that is available throughout the app (the EVENT ID). now... when they click the 'select' button, it closes this first form (after setting my eventID variable) and then displays another form that I will use to display a listbox of all the records in…
Last reply by PlausiblyDamp, -
-
Who's Online 0 Members, 0 Anonymous, 44 Guests (See full list)
- There are no registered users currently online