Jump to content
Xtreme .Net Talk

CAVESTER

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by CAVESTER

  1. Hi, Can anyone give me a hand here please, I am currently banging my head against a wall trying to figure out how to do this! What I want is a server application which can be connected to by a client application over the internet (http). The client must be able to pass parameters to the server i.e. in a function. The server must also be able to detect i.e. run code when the client connects or disconnects. I have been looking at .NET Remoting but can not find any samles showing how to detect client connects/disconnects from the server. Is Remoting the way to go or am I looking in the wrong place? P.S. I am using C#. Thanks, Lee.
  2. Hi Guy's, Wonder if anyone can point me in the right direction here? Been looking for a way to create a report from data I have in MySQL. However I would like the end user to be able to change the report style on-site. I thought I would look into XML and XSL in order to create a HTML page for the report so that the user could edit the XSL file if required. However this is a C# desktop app rather than a web app so I was wondering... A) Am I looking at the right method to do the job i.e. XML & XSL (I am also stuggling to find any examples)? or B) Should I look into Crystal Reports for a better solution (is this free to distribute with your app when you use the .NET integrated version)? Thanks, Lee.
  3. Hi all, Hope someone can give me a hand here :( . I need to create an application for work in which I will require report/document printing. For this reason I would like to use Crystal Reports in .NET. However after looking at CR I am not sure whether it can format the report/document in the way I need. For example, I currently have a paper document like the following which I need to replicate on screen, only instead of the data being written on the form, it is extracted from the database... -------------------------------------- Project Number: 12345 Project Title: Test Project Project Participants; Role Organisation Client A Company Ltd Promoter B Company Ltd Engineer C Company Ltd Contracting Name: My Company Ltd -------------------------------------- ...However I tried doing this in CR but I can't work out how to get it to format in this way as the details section iterates giving me... -------------------------------------- Project Number: 12345 Project Title: Test Project Project Participants; Role Organisation Client A Company Ltd Contracting Name: My Company Ltd Project Number: 12345 Project Title: Test Project Project Participants; Role Organisation Promoter B Company Ltd Contracting Name: My Company Ltd Project Number: 12345 Project Title: Test Project Project Participants; Role Organisation Engineer C Company Ltd Contracting Name: My Company Ltd -------------------------------------- All I need to do is get a report to go.... single values List of values Single Values List of values etc... Hope someone can point me in the right direction :( Thanks!! Lee.
  4. Thanks guys, I looked at the timer stuff but it didnt seem to give me exactly what I wanted so I hunted around and found a WMI class called Win32_ScheduledJob. This will let me add items to the Schedule Tasks list in Windows NT/2000/XP. This seems to do what I require as all I really need it to do is fire an app at the users requested spacific time and duration. Cheers for the responses :) , Lee.
  5. Hi, Can anyone point me in the right direction on what I need to look at which will allow me to fire some code at a spacific time of day? For example; I want to be able to create a Windows Service that will run some code in order to check a database every day at 1pm. I have looked at timer controls but these only seem to enable intervals from when the service starts to a spacific millesecond time :confused: What I want to eventually create is a Service which checks a database to inform the user of any changes via a windows form which pops up, however I have also read that you cannot use forms with Windows Services, is this correct? Thanks, Lee.
  6. Hi all, Can someone point me in the right direction of how I go about implimenting colours to my controls which change when the Windows theme colours are changed. I cant seem to find info on this anywhere? The same sort of thing which divil has in his controls. Cheers, Lee.
  7. Wondered why it wasn't working, I did think however that changing the base form should change any derived forms but it didn't? L.
  8. Hi Folks! I am trying to do a simple thing here :rolleyes: Anyway, what I am trying to learn is the basic art of Inheritance and what I thought I'd like to achieve is... if I have say five forms in my app and I click a button on one of them I want all the forms to change color. Like when you change the colors in XP and all window frames change color. I had a go but unfortunatly not very successfully. Can someone point me in the right direction please? Thanks, Lee.
  9. Oh boy, thanks for that but I now have another problem. Here is what I have.... ListBoxContactSearch.DataSource = ds ListBoxContactSearch.DisplayMember = "Contacts.surname" ListBoxContactSearch.ValueMember = "Contacts.contact_id" Basically I have bound the dataSet to the listboxes datasource and assigned the Data and value members accordingly. This seems to work fine. However, when I try the call the SelectedValue property from the ListBox like so... ' THIS IS INSIDE THE LISTBOX SelectedValueChanged EVENT TextBox1.Text = ListBoxContactSearch.SelectedValue ... I get an error stating "Cast from type 'DataRowView' to type 'String' is not valid". Any Ideas? Thanks, L.
  10. Hi, If I have a listbox and I am populating it with peoples names from a database this is fine. However, I also need to store that persons database ID, but not to be seen at runtime by the user. This is because when the user clicks on a name, the details are going to be retrieved from the DB, however 2 people may have the same name so I defo need the unique ID to identify what I need to return. My question is though, does anyone know how I should go about doing this? I dont see a listbox item tag property or anything I can store this type of data in. Cheers, L.
  11. Sorted it in the end guy's thanks for the input. It was because the code was inside of the click event and the treeview selection does not happen untill after the click has been made. Putting the code into the double_click event solved it. :) L.
  12. in the debugger the SelectedNode property is stated as being "Nothing". I guess this why I am getting the error but why is it "Nothing" if I have selected it? :confused: L.
  13. an item has been selected from the treeview (the code is in the TreeViewAddressBook_Click event) and the tag does have a number in it as I can identify this when populating it via the debugger. However when I try to extract the number (database record ID) back from the tag it all goes a bit wrong as I stated above. I thought it may be something to do with the tag being of type object and trying to pass it to a string but a Ctype() conversion construct makes no difference. Anyone got any helpfull info on treeviews in VB.NET? Cheers, L.
  14. TreeView Tag Property Hi all, Been having a bit of a mare! for the last hour or so, I just cant figure out how to retrieve a value out of the treeview controls tag property. Can anyone help please. What I have is... Dim strSelectedNodeID As String strSelectedNodeID = TreeViewAddressBook.SelectedNode.Tag ...however it doesn't work as I get an error of "object reference not set to an instance of an object" on the line above. Cheers, L.
  15. Thanks Iceplug that will do nicely :) L.
  16. Hi all, Can anyone tell me how to stop my form from loosing focus? I have a MDI application in which I have a child form which has a button inside. When this button is clicked it opens another form which is owned by the child. However I would like this newly opened form to be the only form in the app someone can control until they close it with its close button. Any Ideas? Cheers, Lee.
  17. Hi, I tried what u have suggested but I have had no joy. here is what I have, I get no error messages or anything just no updated database!!!:mad: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim MyDS As New DataSet MyDS = Me.GetProjects Dim Str As String = MyDS.Tables(0).Rows(0).Item(0) ' Create a new row in the dataset... Dim MyRow As DataRow MyRow = MyDS.Tables.Item(0).NewRow() ' Set the field values of the new row... MyRow("project_number_id") = 1 MyRow("project_title") = "test" MyRow("email_path") = "test path" MyRow("live") = True ' Add the new row to the collection... MyDS.Tables.Item(0).Rows.Add(MyRow) Me.UpdateProjects(MyDS) End Sub Public Function GetProjects() As DataSet Dim MyConn As New OdbcConnection(cConString) Dim selectSQL As String = "SELECT * FROM projects" Dim mySelectCommand As OdbcCommand = New OdbcCommand(selectSQL, MyConn) Dim myDataAdapter As OdbcDataAdapter = New OdbcDataAdapter(mySelectCommand) Dim dsReturn As New DataSet Try myDataAdapter.Fill(dsReturn, "Projects") Return (dsReturn) Catch exc As Exception Throw exc Finally mySelectCommand.Dispose() myDataAdapter.Dispose() MyConn.Dispose() End Try End Function Public Function UpdateProjects(ByVal dsProjects As DataSet) As Boolean Dim MyConn As New OdbcConnection(cConString) Dim selectSQL As String = "SELECT * FROM projects" Dim myDataAdapter As OdbcDataAdapter = New OdbcDataAdapter myDataAdapter.SelectCommand = New OdbcCommand(selectSQL, MyConn) Dim myCommandBuilder As New OdbcCommandBuilder(myDataAdapter) Try myDataAdapter.Update(dsProjects, "Projects") Return True Catch exc As OleDb.OleDbException Return False Throw exc Catch exc As Exception Return False Throw exc Finally myCommandBuilder.Dispose() myDataAdapter.Dispose() MyConn.Dispose() End Try End Function Can anyone spot whats wrong? Cheers, Lee.
  18. Yes, the class as I see it would also incapsulate functions which would allow the use of the DataAdapter, however my question is really to do with how I should be doing it in an OOP manor i.e as in my example how do I return the DataReader object or DataAdapter object for that matter yet still be able to close it hence keeping everything "clean" without jeperdising the returned object. Or...do I need to create another method in my class which just closes the DataAdapter and hence need to call it after I have used the DataAdapter method and finished with it? i.e Dim oDB as New CDatabase //class CDatabase is the class in my above code. Dim oDA ad odbcDataAdapter ' oDA = oDB.ReadData(SELECT * FROM Customer) // Do stuff with returned oDA DataAdapter object oDB.CloseReader Cheers, Lee.
  19. Hi all, Quick question... from a syntax and a programaticly correct point of view, is it better to form a construct like this... If oDB.GetObject Is Nothing Then Exit Sub End If Continue... or this... If Not oDB.GetObject Is Nothing Then Continue... End If Cheers, Lee.
  20. Hi all, I'm starting a new project and want to try and use OOP as much as possible (I'm not that familiar with it yet but get the general idea)...anyway, I want to connect to a MySQL database and do various database things such as read data, edit data, insert and delete etc. My whole app will use the database methods so therefore I am wanting to create a Database class so that I can encapsulate all the database methods I want to use within the one class. My question is how do I go about doing this?...Here is what I have thus far... Public Class CDatabase Const cConString = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=localhost;" & _ "DATABASE=eQA;" & _ "UID=root;" & _ "PASSWORD=;" & _ "OPTION=3" Dim oConn As OdbcConnection Public Sub New() oConn = New OdbcConnection(cConString) Me.Connect() End Sub Private Sub Connect() oConn.Open() End Sub Private Sub Disconnect() oConn.Close() End Sub Public Function ReadData(ByVal strSQL As String) As OdbcDataReader Dim oCommand As New OdbcCommand(strSQL, oConn) 'Dim oReader As OdbcDataReader ' oReader = oCommand.ExecuteReader() ' Return oReader ' oReader.Close() // Buggered because of this! End Function End Class My problem is that I have to close the DataReader (best practice) but I cant as it stands because the .Close method gets ignored because of the "Return oReader" statement and If I close it first before returning it to the calling class then the DataReader in the calling class is closed and I can no longer use it. Do I have to create separate methods used to close the DataReader when I am finished with it in the calling class? HELP IM CONFUSED :confused: Cheers, Lee.
  21. Stupid question but why should the ActiveX control never be used? L.
  22. Not sure if I understand fully what you are saying but I cant get access to the DMZ where the web server is located via TCP/IP unless accessed via FTP with appropriate cridentials. I am therefor unable to access the Web/DB server through a normal TCP/IP connection in order to interogate the DB. Hence the only way around it I can think of is with XML web services? :confused: L.
  23. Hi guy's, At present the people I work for use an Access database to store client information in, as well as what products they have etc. What we are wanting is to integrate this into our website so that the customer can log in and view their details etc. However...the Access DB is inside the companies firewall and we cant put it on the web server as this is located within the demilitarized zone and thus direct connection over TCP/IP to further enable us to work with the data is not possible. What I am wanting to know is what is the best technology to use to get round this problem. I am thinking along the lines of a .NET XML Web Service enabling me to both access the DB via the web service for displaying info on the site to the customers and also enabling access via HTTP from a desktop VB.NET application in order to mimic what we have currently in our Access DB. Does anyone have any ideas/suggestions that I havn't contemplated, or indeed does anyone have any experience with Web services? the possibilities look pretty good from what I can read! Cheers all, Lee.
  24. Hi all, I have a strange one... I have a ListBox and want to change the first row, 3rd column's cell by changing the ForeColor property to dark red. I have used the syntax line shown below with no joy what so ever, there are no error or anything it just accepts the line as correct but fails to change the property requested, however I fail to understand why. Do any of you know what I am doing wrong here? ListView1.Items.Item(0).SubItems.Item(2).ForeColor = Drawing.Color.DarkRed P.S. I can change the whole row by using; ListView1.Items.Item(0).ForeColor = Drawing.Color.DarkRed So why not the individual cell? Cheers, Lee.
  25. Hi, I'm just reading about this but it seems to me that your Dataset Schema must identify the column au_id as a Primary key unique column and therefore cannot be blank, hence the error your recieveing? Not sure how you would identify to your schema which number it should use though to identify the row though as you would not be interacting directly with the datasource at this time? Maybe if you ensure that you au_id column is set as; au_id.AllowDBNull = False au_id.Unique = True Then the unique value wouldn't be assigned until you submitted the Dataset changes to the Datasource? Lee.
×
×
  • Create New...