
corpse
Members-
Posts
13 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by corpse
-
I have a large document that is automatically created, however the numbering style isn't getting set right... Here's some of the code I'm trying: Dim oP As Object ' Word.Paragraph Dim x As Object ' Word.ListTemplate x = m_objWordApp.ListGalleries.Item(3).ListTemplates.I tem(4) Try For Each oP In m_objBaseDoc.listparagraphs If oP.Range.ListFormat.ListType = 0 Then ' wdListNoNumbering oP.Range.ListFormat.ApplyOutlineNumberDefault() End If oP.Range.ListFormat.ApplyListTemplate(x, False) Next The line with .ApplyListFormat is causing it to break, it says Type Mismatch on x. I am trying to enforce that the list is set with the 3rd outnline numbering method, so my items are like 1.0, 1.1.1, 1.1.2.3, etc... While at it, I'm also trying to get the lines to indent properly. When I send a vbTab it indents the text, but doesn't indent the list level.. ie: if indenting the second item, it would appear: 2.0 text instead of 1.1 text
-
I have a single page template, say it's for an employee ID, and my database has 5 records. My goal is to print off the employee ID's, and have a word document with 5 pages. Each page will be based on a template. (VB.Net by the way) I have the template created, and have bookmarks setup to locate the text insertion points. I can create the first page very easily; goto bookmark, insert text, repeat. Although, I'm stuck now that I want to create the second page. Ideally, I would like to insert a new page based on my template. I can't create everything on the fly, as that will make using a template pointless. EDIT: I found a solution, although I'm not very happy with it. For each record/page of the report, I create a new document based on a template and save it; and then dumb all of those pages into a master document. It's slow, but does give the power, and was easy to implement. I KNOW there is a better way - like my creating the document in memory and copy into a document via a range, but getting the right combo of code has been rather elusive. Help and suggestions are definitely welcomed and highly recommended :)
-
I have tried connection pooling, but I dunno, it seems slow to me... My order entry system can have 50 people using it, and there's alot going on with it. So, I really don't mind each workstation maintaining an open connection - I'm not concerned with how many connections I use in regards to licensing, as I'm covered in that area. If blnConnect Then m_cnnStars = New SqlConnection(SQL_CONNECTION) This is correct (or so it seems), as my logic determines if the system should reconnect to the sql connection, so if blnConnect is true then it will proceed to create the New SqlConnection. The logic in the Connect routine in my DataAccess says that if the connection is Nothing, or the connection is closed, then to set blnConnect to True and then proceed with creating a new connection.
-
I have a vb.net app that is working with sql2k.. My app is loaded up with classes of objects I created for data access related stuff, as I prefer not to use datasets.. To read data, I'm calling ExecuteReader from a SqlCommand, which is based on a SqlConnection. The code for the above is stored in my DataAccess object (my "data access layer"), but I'm having 2 main problems, but I'll just discuss the important problem now... Even though I try, and seem to be, reusing the current connection, it keeps creating a new connection in SQL, and after I load the same order, say 5 times, I will have 10 new connections in sql. Below is some of the code I'm using, maybe there is a glaring mistake I'm making.. Or if someone has an appropriate link or something that discusses the proper/better way to acheive what I'm trying to accomplish, I'm all ears... Also, the dataaccess layer is dim'ed in my global where the majority of my objects is called, so in the application I would call it by something like: If global.DataAccess.ExecuteReturnResults(strSQL, myReader) Then If myReader.HasRows = False Then ..... The following code is all from my DataAccess object.. Public Function ExecuteReturnResults(ByVal strSQLToExecute As String, ByRef sdrDataToReturn As SqlDataReader) As Boolean Dim cmdStars As SqlCommand Try If Connect() Then cmdStars = New SqlCommand(strSQLToExecute, m_cnnStars) sdrDataToReturn = cmdStars.ExecuteReader Return True End If .... Private Function Connect() As Boolean Dim blnConnect As Boolean Try blnConnect = False If m_cnnStars Is Nothing Then blnConnect = True Else If m_cnnStars.State = ConnectionState.Closed Then blnConnect = True End If End If If blnConnect Then m_cnnStars = New SqlConnection(SQL_CONNECTION) m_cnnStars.Open() End If Return True ....
-
yes, that does help.. I now have simple objects serializing, yet giving me a little more hope :) Now, I'm trying to take a simple collection and do the same thing. I have tried a WIDE variety of things, namely adding xmlroot and xmlelement in a variety of places <g>, but I get all sorts of messages.. Message: "There was an error reflecting type 'TestXMLSerialization.clsXml'." If I serialize the Setting object by itself, it serializes fine and spits out the xml file. But if I serialize the collection, it fails. Whats the trick on serializing the collection? here's my collection code: Imports System.Xml.Serialization <XmlRoot("root_SETTINGS")> _ Public Class Settings Inherits System.Collections.CollectionBase . . ' typical functions in here.. like Add, Remove, Item, Count . End Class
-
I have a class with a handful of objects and collection, for example: I have a customer class with various properties, like name, address, city, state, blah blah.. Inthat class is a contacts collection. The contact class would have some basic props like name, addres, phone, email, login id. Of course, a customer can have mutliple contacts. I want to be able to serialize that data into a xml structure. How would I go about serializing this type of info?
-
I'm in the middle - I'm 29 and have been programming in basic since I was 13 :-O I do mostly client/server type database apps using MS stuff (vb, vb.net, access, sql server), and also a pro developing in Cold Fusion. Other things I "do".. - into making my 69 stang something faster and scarier - rock climbing - my new obsession.. I guess I like to get high :p
-
Here are 2 chunks of the code, the first is the employee object.. the second is how I'm using it and where it fails.. The Employee object is in the isrOrderEntry project/solution (the middler tier).. The new order button is on a MDIChild form in the front-end. I create the Employee object like... Public Class Employee Private blnIsDirty As Boolean Private p_intempid As Int16 Private p_txtLoginID As String Private p_strLastName As String Private p_strFirstName As String Private p_lstGroups As New ArrayList Public Property EmployeeID() As Int16 Get EmployeeID = p_intempid End Get Set(ByVal Value As Int16) p_intempid = Value End Set End Property . . Public Sub New() blnIsDirty = False p_intempid = 0 p_txtLoginID = "" p_strLastName = "" p_strFirstName = "" p_lstGroups = New ArrayList End Sub End Class Here's the new order code... Private Sub btnNewOrder_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewOrder.Click ' blank out the current order Me.oOrder = New isrOrderEntry.Order Dim tmpform As frmOrderParent tmpform = Me.MdiParent oOrder.OrderTaker = New isrOrderEntry.Employee oOrder.OrderTaker = tmpform.EmployeeLoggedIn ; *** The above line is the ONLY line that refuses to work.. if I Stop at this line, tmpform.EmployeeLoggedIn has all properties set with values; but oOrder.OrderTaker stays at the same values. Dim tmpLI As New isrOrderEntry.LineItem oOrder.LineItems = New isrOrderEntry.LineItems oOrder.LineItems.Add(tmpLI) tmpLI.Star.StarName = "test" tmpLI.Star.StarDate = Now() oOrder.LineItems.Item(0) = tmpLI tmpLI = Nothing Stop End Sub
-
I'm confused about a simple set statement... I have an object called Employee, which it's properties are set when the app loads. Then as a public form variable I have my oOrder object, and that has an OrderTaker property of the Employee type. When I click the new order button, I'm doing... oOrder.OrderTaker = new isrOrderEntry.Employee oOrder.OrderTaker = tmpform.EmployeeLoggedIn <--- problem line EmployeeLoggedIn is also of Employee type, and I have confirmed that EmployeeLoggedIn has all of it's properties set. When I hit the problem line, it does not give an error, but it does not set the data. I can set the properties 1 by 1 in the command window, but I can't do this stinkin copy. Every other time it has worked fine.. Am I missing something really dumb??
-
Not sure why this thread was moved - I think it has way more to do with class structure and not data access :-/ Let me try a different approach.. In my UI, I would like to access my "business objects" that are stored in the dll. Some things I'd access... (assume I did all the necessary Dims already).. Orders(1).InvNum (database property, invoice number) Orders(1).Date_Created (db property) Orders(1).EmployeeName (NOT a direct db property, this might be a lookup of hte employee id and return the employee full name). Orders(1).SendConfirmation (this can be a method to send an e-mail confirmation to the customer). Orders(1).LineItems.Count (returns number of lineitems) Orders(1).LineItems(1).ItemID (db property) Orders(1).LineItems(21).Cancel() (Method to cancel out the line item).. As you can see, the order object (and child objects) have a mix of properties and methods, and some of those properties may not be data from the database, but other properties just part of the object. If I'm using a complex DataSet with multiple related tables, how would I (or can I?) use that dataset object model in mine? (refer to the code bits above)..
-
I'm pretty new on the .net scene, so lemme explain what I wanted to do in VB6 that seems hard to do in .NET. I'm redoing an order entry system, and was going to do it in vb6 with vb6 as the front-end which will exlusively access vb6-created active x dll com objects. These dll's will act as the data store along with their respective methods, perfect example is the Order to Payments relationship... Orders collection ---> Order object Order properties: intOrderNumber, txtCustomerName, CanCancel, Payments Order methods: CancelOrder, CompleteOrder (objPayments) Payments collection ---> Payment object same as above (kinda) as the payment object will have properties that are actual data from the database or other misc. properties Now, in the vb6 I would have loaded the data up and simply built up my collections my doing an Add method (into the collection) for each item - it worked great, cuz then in my UI I could call something easy like... objOrder.Payments(1).Validate, and to get the payment ID I could do: objOrder.Payments(1)!guidPaymentTag But in .net, I'm having a real hard time figuring out I can do this stuff using DataSets.. I would still like to have my Orders collection, Order object, LineItems collection and LineItem object (etc...), and in each object have my "data" properties and "other" properties, along with methods.. If I build a DataSet, I don't see how my LineItems or Payments collection can work properly? <sigh> Thanks for your patience in answering!
-
I run F:\ENGLISH\VS.NET\ENTARCH_FINAL_BETA\setup.exe It brings upt he setup screen, showing I need to install the .net prereq's.. then it says "loading installation components..." then a box pops up and says.. "A problem has been encountered while loading the setup components. Canceling setup." I love the meaningful MS error messages :p My system config: win 2k pro with sp2 ie6 w/ sp1 .net 1.1 framework (all that installed ok) mdac 2.7 Any ideas? BTW - This same cd installed "relatively" painless on my win xp pro box..