|
How can i load data from a server database unto a datagrid on a client applicaton
bizzo
|
|
|
|
|
To access data from a server by a client system, the method depends o how are u connecting to DB
If u are using ADO and ODBC you just have to change the server location in data source...
On the server end you have to make it sure that the DB server is listening to the IP of client...i.e. Is your DB server is configured to listen to other IP's or it is just configured for localhost
Hope this will help you a bit...
Regards
Nishkarsh
|
|
|
|
|
Please can you cite an example in a form of short code so as to understand what you mean well. Thank you
bizzo
|
|
|
|
|
Can u send me ur e-mail id and i will and u a example with some a document for how to configure...
Also i will like to know which is the Database U are using... what is the connection type...i.e. how are u connecting to the database on local machine..
Regards
Nishkarsh
|
|
|
|
|
Look at http://www.connectionstrings.com[^] for the connection string you want to use ( not sure if you are using odbc, ole, ado, etc ).
You then need to have your datagrid setup on the client app and tie the datagrid to the query. I'd do a search here at CP and on google before venturing further.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I had made a application in VB 2005, with a form size.. By enabling the auto scroll property i am able to manage the situation when the target screen (monitor) is smaller then native form size.
When the target monitor is bigger and the user wants to make the application full screen, i want all the controls to be aligned and also grow in size depending the screen size...
Is there any way i can achieve that
Regards
Nishkarsh
|
|
|
|
|
This involves proper use of each controls Anchor and Dock properties. Also, you may have to put groups of controls in various layout panels such as the Panel control, TableLayoutPanel, FlowLayoutPanel, GroupBox, SplitContainer, ... What and how you do this depends entirely on what your control layout is and how you want it to behave.
Start by creating a new project and dropping a couple of contorls on a form, playing the the Anchor and Dock properties of those controls, then resizing the parent window to see how they behave. Then add a TableLayoutPanel and start playing around with that, dropping controls into the panel.
Noone is going to be able to tell you step-by-step how to do this. You simply have to experiment with the stuff to learn how it works, then make your own decisions on how to layout your form based on what you've learned.
|
|
|
|
|
Thanks for your suggestion Dave... I will the same...
I was wondering if there is any com component or something like that available they way it was there for VB 6
|
|
|
|
|
No there isn't. Besides, how would it read your mind as to how you wanted the controls to work?
|
|
|
|
|
I have two forms, and what I want is to save the data in both forms to an excel spreadsheet. I want the information in form 1 to appear first, and the information in form 2 to appear after form 1.
e.g. this is the form:
I want the excel spreadsheet to appear like this:
and I want the information on the second form, form 2 to appear on cells J, K, L, M etc... after the first form 1 information.
I have a button that says "Save to spreadsheet" on form 2 and I want to save a spreadsheet with the information in the rext boxes on form 1 and 2 like I showed. Any ideas? I am using VB 2005
In the end we're all just the same
|
|
|
|
|
You can use the Office Interop Library to create the excel spreadsheet.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have a text box on my form called "txtIntrest" and I want it to display the first line in a text file called "Intrest.txt". I also want that, if you change the text in the "txtIntrest", it will ask you for a password and you have to type one in and this changes the information in the text file. If you press cancel on the password screen, it reverts back to what was in text box originally.
Any ideas?
In the end we're all just the same
|
|
|
|
|
Hello Dave,
You can try using the following code implementation. In this I have taken a textbox and a button.
On form load, textbox automatically fills with the first line of the file. On button click, it
will check the text box for any changes and then it will do what you require. It will ask for
password and after verifying the password, make the changes back to the file. password is coded
right now. You can use various techniques to read it from a file.
BEGIN CODE
Imports System.IO
Public Class Form1
Dim myline As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sr As New StreamReader("c:\test.txt", False)
myline = sr.ReadLine
TextBox1.Text = myline
sr.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tempstring As String
Dim result As DialogResult
If Not TextBox1.Text.Equals(myline) Then
result = MsgBox("Do you want to save changes", MsgBoxStyle.YesNo, "Save")
If result = Windows.Forms.DialogResult.Yes Then
Dim pass As String = InputBox("Enter the Password", "Admin", "")
If pass = "Password" Then
Dim sr As New StreamReader("c:\test.txt")
Dim sw As New StreamWriter("c:\Temp.txt")
While Not sr.EndOfStream
tempstring = sr.ReadLine()
If Not tempstring.Equals(myline) Then
sw.WriteLine(tempstring)
Else
sw.WriteLine(TextBox1.Text)
End If
End While
sw.Close()
sr.Close()
File.Delete("c:\test.txt")
Rename("c:\temp.txt", "c:\test.txt")
Else
MsgBox("Wrong Password")
Exit Sub
End If
End If
End If
End Sub
End Class
END CODE
I hope this will give you some idea to resolve your issue.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
hi guys
maskedtextbox1.mask = "##/##/####"
mskedtextbox2.mask = "##/##/####"
i am using maskedtextbox for getting i/p of date. i have taken mask properties short datetime. my data is stored in sql server 2005 where i have taken data type is varchar(10) in dd/mm/yyyy format (28/08/2007 & 31/08/2007).
my problem is that when i execute the sql query for the selected period in maskedtextbox it does not show correct data.
e.g.
sql_str = "insert mdate into xyz (select mdate from abc where " & _
"mdate between" & " '" &maskedtextbox1.text& "' and '"&mskedtextbox2.text&"'"
"and flag= '" & mflag & "')"
or using where condition it is not executing correct data.
can i get where i am wrong ? if is there any more suggestion for me suggest me.
Thanks
bye
|
|
|
|
|
As you are storing the dates as text, you can't do any calcualtions on them (including comparison). You could convert every value to a date in the query, but that's very inefficient.
Store the values as dates in the database, not text.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
hi
but it is working in vb6. so i think that it is possible in vb.net also. if i use dtpicker then is it possible ?
Thanks
bye
|
|
|
|
|
VB6 handles date/time differently than VB.NET and SQL Server. Who cares if it "used to work" under VB6 since you're not using it now.
You absolutely can NOT store dates in the database as strings and expect to be able to do comparisons and math on those dates, when they are not being treated as dates. Instead, they are treated no differently than if you stored "iwjf948fu04f" as your date.
Using a different control will have no effect since you are STILL storing dates as strings and not actualy datetime values in the database.
|
|
|
|
|
Change the data type of database columns to datetime and while storing and changing the values of that field try this statement for dates
Date.ParseExact(txtMasked.text,"Format")
format means "dd/mm/yyyy" i think it is in your case. the above statement will return a Date object which can be sent to database and then retrieved
Salman Sheikh
|
|
|
|
|
And you're telling me this why??
Yeah, but this doesn't solve the underlying problem of storing dates in the database as strings.
|
|
|
|
|
hi friends,
i developed a Vb.net2003 application & i have some crystal reports tooo. & i made i using default report options.. my porblem is i have some currency fields in the report which show the data with 2 decimal places.. but i want that in 3 decimal places..
anybody have any idea..
cheers..
|
|
|
|
|
Left Click on currency field and choose "Format Object" option, After that you saw a "Format Editor" dialog box and go to "Number" Tab.
Select "Custom Style" from Style listbox then click on "Customize..." button, After that you saw a "Custom Style" dialog box and go to "Number" Tab.
Select an option from "Decimals:" combox box that you want to show figures after decimal in currency value.
After the selection of your requirement the Decimals Combos value look like this:
Decimals: 1.000
By default currency field shows two (2) figures after decimal.
|
|
|
|
|
hi,
sorry to late reply... i already tried the method you mentioned.. & i was in research of that for last 2 - 3 days & atlast i found a small solution but big toooo....
sometimes the currency will show 2 decimals even we set the custum style.. so we have to convert that to string & display it.. so the solution is:
totext({fieldname},3,'','.')
if you want 4 decimal place , replace 3 to 4 , also comman (,) instead of dot(.) replace last ( '.' ) to ( ',' )
cheers..
|
|
|
|
|
I've built a VB.NET (VS8 2005) program, and I need it to put the program on Mac OSX (the machine is powerbook G4). I know it is possible with the use of Mono framework. But the setup and converting instruction is frustratingly unclear and confusing, or almost none; can anyone here tell me how to do this, please? Thank You.
Ryan
|
|
|
|
|
The .NET Framework is Microsoft's implementation of the Common Language Infrastructure standard. Mono is an open source project that also implements the CLI standard. Mono is modeled after the .NET Framework but is NOT a 100% compatible replacement for it. You cannot expect an app written under the .NET Framework to "just work" under Mono. The windowing system in Windows is not the same as on any Linux machine, therefor the entire System.Windows namespace in the .NET Framework's base class library cannot be expected to run under Linux. There is an implementation specific to Linux under the same namespace name (I think!) under Mono, but it works differently.
Your app will more than likely need modifications to make it work under Mono. What those modifications are cannot be documented because no documentation can predict what your code is going to do or how it will use Mono's base class library. It's a matter of compiling the app under Mono, see what errors it spits out and fixing the code.
|
|
|
|
|
You can also set up Mono on a Windows PC and do your testing there before you deploy to your Mac.
|
|
|
|