|
i am using a plain datagrid... and the code is not effective...
Dim ColumnButton As New DataGridViewButtonColumn -- generate an error
ive already change it to Dim ColumnButton As New DataGridButtonColumn but its still not working...
|
|
|
|
|
hello cutequencher,
sorry for misunderstanding. This code is for datagridview
i have no idea about DataGrid. so wait reply from others
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hai! I need a Help about to Storing datas in Access 2002!
What is the maximum size allowed in Access2002 to store datas?
I have a error when i save records after the database size reaches above 152Mb, through visualBasic Connection! I have 172 tables in my database, and my initial DB size is 19Mb before saving records !
How can i rectify this problem?
It would be really helpful to me if u help to solve this problem!
Guru!
|
|
|
|
|
Howdy,
The physical database file limit for Access XP is 2 gig. What is the specific problem you are running into?
-------------------------------------------
Damian - Insert snappy one-liner here.
|
|
|
|
|
I have a error when i save records after the database size reaches above 152Mb,
I have 172 tables in my database, and my initial DB size is 19Mb!
|
|
|
|
|
What is the error? Is it 'invalid argument?'
______________________
stuff + cats = awesome
|
|
|
|
|
Invalid data Source is the error statement
|
|
|
|
|
OK. You're going to have to show us the code snippet that is throwing this error and the EXACT error message. You replied to lecky and myself and gave two DIFFERENT errors. Which is it and what is it EXACTLY?
|
|
|
|
|
Invalid physical Storage media is the exact error msg!
|
|
|
|
|
What's the ERROR?? Without that, there's nothing we can suggest to help you.
172 tables in an Access database?? I'd serisouly consider moving this up to SQL Server.
|
|
|
|
|
Invalid Storage media is the error msg!
|
|
|
|
|
Hi everyone,
I basically understand the functionality of shared methods, however I would like to ask if shared method could be the cause of the situation that I am facing now.
This is an ASP .Net/VB .Net application. I have a class called DataEntry, here I also have the properties of data entry, and a shared method GetLastDataEntry, which gets the last data entry from the db using the specified where condition, and put it in a DataEntry object and return the object.
Public Shared Function GetLastDataEntry(strCondition as String) as DataEntry<br />
Dim obj as DataEntry<br />
Dim sql as String<br />
<br />
sql = "SELECT * FROM tDataEntry"<br />
If strCondition <> "" Then<br />
sql &= " WHERE " & strCondition<br />
End IF<br />
<br />
sql &= " ORDER BY DateTime DESC"<br />
<br />
' The sql result will be put into obj here.<br />
<br />
return obj<br />
End Function<br />
On a page, I have the following lines of codes:
Dim objDataEntry as DataEntry<br />
<br />
objDataEntry = DataEntry.GetLastDataEntry("Respiration <> 0")<br />
' "Respiration <> 0" is used for the where clause in GetLastDataEntry.<br />
<br />
' Processing for objDataEntry goes here...<br />
<br />
objDataEntry = DataEntry.GetLastDataEntry("Pain <> 0")<br />
' Here, "Pain <> 0" is used for where clause.<br />
<br />
' Processing for objDataEntry goes again...
The above code is correct in syntax. However, when the page is run, typically on more than 1 pc, I will get an sql exception because of the following sql statement:
Incorrect syntax near keyword WHERE. SQL: "SELECT * FROM tDataEntry WHERE Pain <> 0 ORDER BY DateTime DESC WHERE Respiration <> 0 ORDER BY DateTime DESC"
I wonder if the above is because of the shared method, since it is a class method, somehow the previous strCondition that I passed in is still there. But then again, according to the exception caught, Pain comes in first, then Respiration, whereas on the page, Respiration is called first, Pain latter. But then again, not sure if this is caused by the calling from two different PCs.
Please advice if you have any opinion on this. Appreciate!
Cheers!
Yenyen
|
|
|
|
|
where does strCondition come from ? You could be open for SQL injection attacks.
This is a weird problem, that the method is shared should not cause this. Is this the only code that calls this method ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Depending on the application work flow, strCondition is hard-coded.
Yeah, the method is called from other pages too, with different strCondition that suits the requirement of that page.
Another weird thing is the exception does not happen all the time, it is random. And the whole application works fine in development environment, the problem only occurs in the deployment area. In development, my PC is the server, I open the page on my PC, and also in another PC in the LAN. I do not get the exception! urgh...
What could possibly be the cause.. Should I not use shared for the method?
Thanks
Yenyen
|
|
|
|
|
Shared really can't make any difference. The only way I can see for this to happen, is if you call it elsewhere, using these two strings, and they accidentally get concatenated.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi ,
Though I don't understand why you want Method to be Shared One
just try this sql ="" before setting sql strconnection.
sql = ""
sql &= "SELECT * FROM tDataEntry"
If strCondition <> "" Then
sql &= " WHERE " & strCondition
End IF
sql &= " ORDER BY DateTime DESC"
Thanks and Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
He wants it to be shared because it has no state, and there's no reason for him to create a class instance, to call it.
Navneet Hegde wrote: just try this sql ="" before setting sql strconnection.
If that works, it is indicative of a deeper problem, as his code does not concatenate strings, or store them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thank you for your suggestions. I will try sql = "" as Navneet suggested and monitor the situation to see if the issue happens again.
Cheers!
Yenyen
|
|
|
|
|
Please tell me how to add form into tab control.
Thanks.
|
|
|
|
|
You cannot. You can define your form as a user control and host that control in a form, to make a form of it, or in your tab control.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
I have a class that refreshes a datagridview control. I can call this from various places including forms and it works. It is located in a module.
I have a 2nd module with a class that calls the refresh class from the 1st module and for some reason i can do nothing with the data grid view. Msgbox tells me it is going into the refresh class but i cant even set the datagridview.row count to 0.
Example:
module functions
--Public Class DGV
----Public Shared Sub refresh()
Dim dataGV As DataGridView
dataGV = My.Forms.mainWindow.DataGridView1
dataGV.RowCount = 0
----end sub
--end class
end module
module runtime
--Public Class Watcher
----Public Shared Sub Run()
Call DGV.refresh()
----end sub
--end class
end module
Seems so simple but its killing me - from any form (button_click or form_load) it works fine over and over again. I reference it in a 2nd module and the datagrid does nothing... not clearing...
|
|
|
|
|
commieJerk wrote: ----Public Shared Sub refresh()
Dim dataGV As DataGridView
dataGV = My.Forms.mainWindow.DataGridView1
dataGV.RowCount = 0
----end sub
This is really nasty. Your code is strongly tied to a specific form, why would you call a dll, just to look for a form, and grab a UI element ( which really shouldn't be public anyhow ), and set a property on it ?
If you have a genuine need to do this in a function, pass the datagridrow into the function.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok yea I changed it to Public Shared Sub refresh(ByRef dataGrid As DataGridView).
I am just starting VB - coming from a VBA (access) background so im not used to a lot of basic programming stuff yet cause access does a lot of this stuff for you.
What i am trying to do in a nut shell is - using FileSystemWatcher(), update a datagridview when its change event fires. The problem is doing anything inside the event. I can put stops inside the refresh class and it seems to be clearing the datagridview and reloading the data but it dosent.
When I call the refresh class anywhere elese it works fine?
|
|
|
|
|
OK, this is the FileSystemWatcher that's firing an event ? I don't see any reason why code that's run in there would behave any differently. Is that code in a different dll to the main app ? b/c the main problem I'd expect is that you're updating the wrong datagridview - how do you access it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|