|
It seems that the message tells the story.
Or you set a non null value for bcId or you make it nullable in the DB.
|
|
|
|
|
yup, i set non null value for bcId, but i forget 2 set it automatic generate number because i use bcId is primary key and is not get the value from user keyin.... So after i set bcId to auto generate number in database then my erorr was solve already
anyway thanks for reply n all d best 2 u
-- modified at 6:06 Tuesday 17th January, 2006
|
|
|
|
|
Hi. I think that I saw on a site that I can display Master and Details in the same grid with "+" on the left of each Master's row. and if I click on the "+" so it open the details rows in the same grid with few left margin increment.
can anybody help me please... I forgot where I can find this article
OmarMallat
|
|
|
|
|
I have a picturebox for view some jpg file.
However, the jpg is always larger than the picture box view.
By default,
<br />
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage<br />
after a button is clicked, it change to
<br />
pictureBox.SizeMode = PictureBoxSizeMode.Normal<br />
How can I view the whole 1:1 picture by the control of verticle and horizontal scrolling bar?
Any example/article for this?
Thank you!
|
|
|
|
|
|
Wow, You are so great!
Thank You
|
|
|
|
|
Hi,
I am new to VB .Net so was going thru this e-book. I came across an error which I was unabe to understand. Even writing to their customer support didn't help and they referred me to the author who hasn't replied back for past 2 months. here is the description of the problem
e-Book : Mastering VB .Net
Author : Evangelos Petroutsos
Page Number : 112
Lines In Concern : 15 to 21
Specific Line : 20
Structure Person - Line 15
Dim First As String - Line 16
Dim Last As String - Line 17
Dim Address As String - Line 18
Dim Phone As String - Line 19
Dim EMail(10) As String - Line 20
End Structure - Line 21
My Operating System : Microsoft Windows 2000 5.00.2195
Service Pack 4
IDE : Microsoft Visual Studio .NET 2003
Error Text : "Arrays Declared as structure members cannot be
declared with an intial size"
Problem Description : The code was copied 'AS IT IS' From the book and
The declaration given in the 20th line on the
112th page, where an Array of index 10 is declared
inside the structure, generated the above quoted
error. Please explain the reason for the
occurance of the error.
|
|
|
|
|
The reason it fails is because you can't initialize a structure's members variables upon declaration. This is only allowed in a class. For example, the following is not allowed in a structure...
Public Structure Person
Public Age As Integer = 21 ' Error!
Public Name As String = "Bob" ' Error!
Public Age As New Date(1970, 1, 1) ' Error!
End Structure
Now, how is this related to your array you ask? It's because the following array declaration...
Dim Numbers(2) As Integer
...creates a new array object and is not all that different than declaring it like this...
Dim Numbers() As Integer = New Integer() {0, 0, 0}
So, what can you do about it? You can create an initialization function that will allocate the array for you. Or you can initialize it in a constructor, but remember that a structure can't have a constructor with no arguments.
I hope this helps!
|
|
|
|
|
Hey,
Thanks for taking time to reply to this one.
Yes I do understand and I hope this is the only explanation.
It is not the same in other languages that I know, Example this kind of error does not occut in C or maybe even C++. Still it was a great help.
But I still cannot understand why it was gievn in that book, when the code is generating errors.
Anyways
Thanks a lot
Love
Chameleon
|
|
|
|
|
The Chameleon wrote: But I still cannot understand why it was gievn in that book, when the code is generating errors.
It's a mistake in the book. It happens.
The Chameleon wrote: this kind of error does not occur in C or maybe even C++.
Right, just remember that .NET manages memory differently. Class objects are stored in the heap and are always referenced (in C++ an object can be in the stack or heap). Structures are stored in the stack and are passed by value, just like an Integer. In fact the Integer is really a structure too! It's mapped to the Int32 structure. Short, Long, Single (float), Double, and other primitive types are structures as well. An array is really a class and is something that must be created on the heap.
|
|
|
|
|
It's simply an error in the book.
The error message is completely correct. You can't create an array in the declaration of the structure, you have to create it in the constructor of the structure.
Declare the array as:
Dim EMail() as String
In the constructor of the struct, you create the actual array:
EMail = New String(10)
[With reservations for errors in the code, I normally program in C#]
---
b { font-weight: normal; }
|
|
|
|
|
Thanks a lot for your advice,
It's been really helpful
Regards
Chameleon
|
|
|
|
|
How can we display a message whenever a text box goes out of focus? say if you want to check if the entered value is 0 and display a message only when it is so?
|
|
|
|
|
By handling the Leave event on the textbox.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Try this :
In VB.net
Private Sub TextBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox.LostFocus<br />
' Your Code Goes Here<br />
End Sub
In VB6
Private Sub TextBox_LostFocus()<br />
' Your Code Goes Here<br />
End Sub
It will trigger Lost Focus event in text box "TextBox"
WiL
|
|
|
|
|
|
Hi,
This would be a server side validation code. Anyway that we can use this one only on the client side say using Java script?
|
|
|
|
|
I didnt get what do you mean by "server side validation code". But if you were asking if JavaScript support lost focus event, the answer will be yes.
WiL
|
|
|
|
|
Well,
First of all thats for taking interest.
Now my application is an ASPX application with two sides. One is .VB part where the actions and the code is run on the server and second is the ASPX part where the information is displayed to the client (Preferably in IE or some other browser).
The code that you gave me is working fine but can be only used to validate a certain evernt that is being run on the code. For validation on the client side, I would have to use some scripting language (Preferably Java Script) so that I do not have to post back to the server and thus minimize traffic.
Just wanted to ask if you have any idea how the same concept can be used in Client side validation?
Thanks
The Chameleon
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head runat="server"><br />
<title>Untitled Page</title> <br />
<script language="javascript" type="text/javascript"><br />
function Text1_onblur() {<br />
}<br />
</script><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<input id="Text1" type="text" onblur="return Text1_onblur()" /> </div><br />
</form><br />
</body><br />
</html>
Dude, I know nothing at all about aspx nor javascript. All I just did was open Visual Studio, add a text box, view the source code, select my text box name and choose an event. It automatically generate those codes.
What I'm trying to say is you should explore more about .Net by yourself before asking and also there's MSDN where you can find answer for most of your problems.
CMIIW
WiL
|
|
|
|
|
Dear all,
I was trying to automatically to import data from excel into Access Database.
The code was like this.
Dim myUploadConnection As New ADODB.Connection<br />
Dim SQLString As String<br />
Try<br />
myUploadConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Application.StartupPath & "\HDTL.xls; Extended Properties=Excel 8.0;"<br />
myUploadConnection.Open()<br />
<br />
SQLString = "SELECT * INTO " & _<br />
"[PROVIDER=Microsoft.Jet.OLEDB.4.0; DRIVER={Microsoft Access Driver (*.mdb)}; " & _<br />
"DBQ=" & Application.StartupPath & "\PlasmaDB.mdb;].HDTL " & _<br />
"FROM [HDTL$]"<br />
<br />
myUploadConnection.Execute(SQLString)<br />
myUploadConnection.Close()<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")<br />
End Try
When run the proses I received error message "Can't Update. Database or object is read only".
Please tell what have I missed
Many thanks and regards,
WiL
|
|
|
|
|
hi all,
i have my web application running on a server and i found out that the aspnet_wp.exe process causing a high CPU usage on the server (running win server 2k with IIS 5.0 and .net framework 1.1). It caused my application running slow and stopped responding. Is that the framework problem? Any ideas how to solve that? thanks in advance
elcheah
|
|
|
|
|
That depends entirely on what code is running to cause the high CPU usage. Normally, this is something you wrote and not a problem with IIS or the .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
System.NullReferenceException: Object reference not set to an instance of an object. at ForumVB.dotForumTopicEdit.editTopic.submitter_update(Object sender, CommandEventArgs e) in c:\inetpub\wwwroot\ForumVB\admin\topicEdit.aspx.vb:line 109
plz help me...........
|
|
|
|