|
Thank you for your help, i´ll see what i can do
|
|
|
|
|
Is it possible when populating a datagrid you can use an array of values. What I mean can you use the fill dataset i.e. .Fill(dataset, "Customers")
What I am trying to use, is use the DataGridTableStyle methods i.e. mapping etc
At the moment I am using this method ......
dt.Columns.Add(New DataColumn("Floor", GetType(String)))
This is not very good as I cannot get seperate width etc or the properties of DataGridTableStyle
Am I doing something wrong or how can the above be done.
Thanks in advance
|
|
|
|
|
hi,
I am using sqlDataAdapter select command based on multiple tables using INNER JOIN to populate DataSet . I wanted to update only one table data by using UpdateCommand Property. plz help me to write Update Command. SelectCommand is as
sql = "SELECT a.prepaidID,a.revAccountNo,a.AccountNo AS origAccountNo," & _
"a.totalAmount, .description, .distAmount,b.fromDate,b.toDate,b.vtCode,
b.voucherNo,b.voucherDate" & _
" FROM prepaidDistribution a,prepaidDistributionDetail b" & _
" WHERE a.prepaidID = b.prepaidID and a.companyCode='" & compCode & _
"' and b.fromDate>='" & startDate & "' and b.toDate<='" & endDate & _
"' and b.vtcode IS NULL and a.accountNo like '" & accountNo & "%'"
plz help immediately
|
|
|
|
|
Hello,
How can I export a Interbase/FireBird table into a MS Access table from VB .Net code?
Many thanks
|
|
|
|
|
I have created a project with som classes .... ... I created a second project with a class with inherits a class from the first one ..... Then I create an WinApp-project and make a reference to the second project (with the inherited class) ... try to set some propertied etc ... gets an error because I have not set an reference to the base-class project .... Can I get around this? Both classes belongs to same Nampespace (DOG.xxxx and DOG.yyyy) but resides in different projects/assemblies
//Maw
|
|
|
|
|
right click on the project references to add a reference to the project from which the base class comes from...
then, import it if you want, but be careful to the ambiguous name resolution...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi
I know how to store the image in database but i want to know how to for example :
First Capture an image then allow the user to draw a line as in GRAPH x co ordinate & Y co ordinate on the image
and store this image in the oracle database
Pls help me.
Regards
Lion Heart
Software Engineer
Bangalore
|
|
|
|
|
I am writing a program that will have two purposes and need some guidance. The first purpose is for data entry of survey responses. All responses are numerical and must fall within a range specified for each question, so the input must be validated. For example, if the question is asking the height of the subject, then the response must fall between 48 inches and 84 inches. Is there a way for the program to read the limits from another source, say a file? The client wants to be able to change the limits very easily and I have a separate window that will display and allow them to change these limits for each question. How do I get the system to read these values and validate the responses?
The second purpose is to store the data in some fashion. Each person taking the survey is considered a 'subject'. Each subject will have a response to each of the 20 questions, so I would imagine that a database would work, creating a 'subject number' as a primary key. How would I go about doing this in VB? Is this the best way to go, or I am off the path here. The client would ideally like to see all of the subject data in an excel spreadsheet, so maybe I could go that way too. Any input would be greatly appreciated.
|
|
|
|
|
cheeseflea wrote:
Is there a way for the program to read the limits from another source, say a file?
You can write a generic validation function and then read the limits from a config file, yes. I'd assume the file would be XML, and would contain the questions with a node group for validation required.
cheeseflea wrote:
How do I get the system to read these values and validate the responses?
The easiest way to deal with data is XML, then you'll need to provide a UI to generate that XML and edit it.
cheeseflea wrote:
How would I go about doing this in VB? Is this the best way to go, or I am off the path here
Hmmm... if your set of questions is going to be large enough, perhaps a full on database solution is required. Either way, I'd be more inclined to offer editing of questions in your own UI, not via Excel.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I developed a small vb.net solution for a friend.
The system is going onto a shared hosting environment.
The last page consists of a small datagrid, some text boxes and a multipage datagrid at the bottom.
I need to print the last page and could not figure out how to do this with a multi page datagrid.
Therefore, I took the pagination off the datagrid so I in effect, created one large web page.
I have two problems.
The first problem is that the users need to set the printer to Landscape mode.
I would like to do this programmatically so they would only have to click the Print button on the browser.
The second problem happens when I try print the "Page".
The length of the datagrid is dynamic due to wordwrap and when I try to print the page,
sometimes the upper half of the last line on the page appears at the bottom of page 1
while the bottom half of the same line appears at the top of page 2.
The line is actually split horizontally.
Thanks for any help given,
Art Sterling
|
|
|
|
|
You can't control the client browser from ASP.NET. This would only be possible, if at all!, by client-side JavaScript in the page your sending. Though, I don't know how to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks,
I think I will just put a message telling the user to set the printer to Landscape mode.
|
|
|
|
|
i have two forms:
--------------
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr As Form2
fr.test()
End Sub
End Class
---------------
Public Class Form2
Inherits System.Windows.Forms.Form
Sub test()
MsgBox("Hello")
End Sub
End Class
---------------
with this i have the error:
"An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
My question is: how i can acess from form1 to a sub or a function in form2. Putting "shared sub" it works but exists another way to make this?
waiting you help.
Thanks.
|
|
|
|
|
|
makeko wrote:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr As Form2
fr.test()
End Sub
End Class
"An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
Your error occurs at fr.test() because you haven't created an instance of Form2. Change the line:
Dim fr As Form2
TO
Dim fr As New Form2
Now you should be able to access fr.test()
|
|
|
|
|
It works. But if form2 already exists and i want to put data on it.
Like this:
-----------------------------
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Public Sub teste()<br />
TextBox1.Text = "Hello"<br />
End Sub<br />
<br />
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim fr2 As New Form2<br />
fr2.Show()<br />
End Sub<br />
End Class
------------------------------
Public Class Form2<br />
Inherits System.Windows.Forms.Form<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim fr1 As Form1<br />
fr1.teste() ***<br />
End Sub<br />
End Class
------------------------------
*** ERROR: "An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
Without using "shared sub", i don't know how to put this working.
Waiting help...
Thanks.
|
|
|
|
|
makeko wrote:
Public Class Form2
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr1 As Form1
fr1.teste() ***
End Sub
End Class
------------------------------
*** ERROR: "An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
You made the same error...but this time you did not create an instance of Form1 in the Form2 button event.
You had:
Dim fr1 As Form1<br />
fr1.teste() ***
Where you should have
Dim fr1 As New Form1<br />
fr1.teste() ***
Also, please take the time to read this article, it may help you with your situation.
http://www.devcity.net/Articles/94/multipleforms.aspx[^]
|
|
|
|
|
Ok, that work but with that the text on the textbox isn't modified, because is created a new instance and i have already one Form1 created and i want to change the text on texbox of this one.
If you can, try the code that I put here previously.
thanks for the help...
|
|
|
|
|
The reason why the textbox isn't modified, as you have said already, is because you are creating new instances of Form1 or Form2 in every button event. Is Form1 acting as a dialog box? If so, have you tried the InputBox class??
If you are trying to access a sub procedure inside a Form, you may want to consider using Events or as you have said before, a Shared method. But it really depends on what this "method" is trying to accomplish.
|
|
|
|
|
What i'm trying is:
I have 1 form ( form1 ) that when i click in a button open another form ( form2 ) with a datagrid where i can select one user with a keypress or a doubleclick. After that, the form2 closes automatically and i want that the data in the row selected on datagrid goes to textboxs in form1. I have the data in one dataset.
How you would decide this problem?
Can you tell me the better way to do that?
thanks for the help.
|
|
|
|
|
I would suggest using Events to perform what you would like to do. I posted a link earlier, but I'm assuming you haven't read it.
http://www.devcity.net/Articles/94/multipleforms.aspx[^]
Anyway, since you are not willing to read the link...here is some sample code:
In Form2 (the one with a Datagrid):
<br />
Public Class Form2<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
...<br />
#End Region<br />
<br />
'declare an event that can be caught in Form1 code<br />
'you can name this whatever you want<br />
Public Event OnRowDoubleClicked()<br />
<br />
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'databind your datagrid here or in design mode<br />
End Sub<br />
<br />
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick<br />
'This is if you want to close your window on a when <br />
'the user double clicks a row<br />
<br />
'raise the event to be caught in Form1<br />
RaiseEvent OnRowDoubleClicked()<br />
<br />
Me.Close()<br />
End Sub<br />
<br />
Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _<br />
Handles MyBase.Closing<br />
'cancel closing of form<br />
e.Cancel = True<br />
'hide the form from the user<br />
Me.Hide()<br />
End Sub<br />
End Class<br />
Now in Form1 (the one with the Button and TextBox):
<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
...<br />
#End Region<br />
<br />
'declare a Form2 with events - the key to handling the <br />
'doubleclick in Form2<br />
Private WithEvents f2 As Form2<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'display the form to the user<br />
<br />
'check if Form2 has been created<br />
If Not f2 Is Nothing Then<br />
If Not f2.IsDisposed Then<br />
'display form if not disposed<br />
f2.ShowDialog()<br />
Else<br />
'create new instance of Form2<br />
f2 = New Form2<br />
f2.ShowDialog()<br />
End If<br />
Else<br />
'create new instance of Form2<br />
f2 = New Form2<br />
f2.ShowDialog()<br />
End If<br />
<br />
End Sub<br />
<br />
<br />
Private Sub f2_OnRowDoubleClicked() Handles f2.OnRowDoubleClicked<br />
'handle the double click event in the datagrid of Form2<br />
'now you can access the Datagrid information since it is a public control <br />
'in Form2...like so:<br />
TextBox1.Text = f2.DataGrid1....<br />
End Sub<br />
End Class<br />
It's up to you to figure out the rest...but I really do suggest you read the article that I linked!
A.S.
|
|
|
|
|
Thanks for everything.
It works very well.
Persons like you makes the codeproject big.
One more time, Thanks.
|
|
|
|
|
Can a tuple within a table hold a URL that points to a particular file, so that when a SELECT is made on that tuple it will open up the file itself?
|
|
|
|
|
SQL questions belong in the SQL Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, a SELECT is only going to select data, not realise it's a URL, let alone visit it.
Christian Graus - Microsoft MVP - C++
|
|
|
|