|
hi all,
i just Want To create a program with a datagrid, connectrion , and recordset object.
My problem is that data grid does not show the records in it.and gives no Error
please solve my Problem.
the Coding i use
Option Explicit
dim rec As new ADODB.Recordset
Dim con As New ADODB.Connection
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim str As String
With con
.Open ("Provider=Microsoft.jet.oledb.4.0 ; data Source=C:\Documents and Settings\Administrator\Desktop\vc.mdb")
End With
'Set rec = New ADODB.Recordset
str = "select * from invtrans"
'If con.Open = adstaeopen Then con.Close
rec.Open str, con, adOpenStatic, adLockOptimistic
'MsgBox rec.RecordCount
'rec.MoveFirst
MsgBox rec.Fields(1)
Set DataGrid1.DataSource = rec
'Set DataGrid1.DataBindings = rec
End Sub
manoj
|
|
|
|
|
Friend ,I too faced this problem at lot time.
i tried a method and added a ADO control on the form . Connect the control in the code and pass the recordsource i.e ur SQL statement and then set datagrid's datasource using this control.
I think it can solve ur problem . In case u find another solutions please do let me also know abt that.
deepaish
|
|
|
|
|
ashu
|
|
|
|
|
how to ask a question :
1. speak english
2. use the thread title as a very short summary
3. use the thread body to actually ask your question instead of your boring " "...
4. hope that someone will close one's eyes on this...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 6:10 Monday 9th January, 2006
|
|
|
|
|
You're asking a very general question. One which, just by asking it, tells us you don't understand the basics of developement. It sounds as if your in over your head.
If you don't understand how your data works on paper, no one here can describe it to you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI
CAN ANY ONE TELL ME WHAT IS A "WINSOCK" AND "MAPI" CONTROLS AND THE USES.
ITS URJENT.
BYE
Paritosh
|
|
|
|
|
MAPI: MAPI is an acronym for Messaging Application Programming Interface. MAPI allows client programs to become (electronic mail) messaging-enabled.
Winsock is an alias for Windows Sockets enables programmers to create advanced Internet, intranet, and other network-capable applications to transmit application data across the wire, independent of the network protocol being used (retrieved from msdn).
I hope it helps,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
which protocol winsock uses while transfering data
Paritosh
|
|
|
|
|
Winsock implements TCP/IP protocol so by means of Winsock you can implment FTP, SMTP, ...
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
paritosha wrote: CAN ANY ONE TELL ME WHAT IS A "WINSOCK" AND "MAPI" CONTROLS AND THE USES.
A bit of elementary research will tell you this.
paritosha wrote: ITS URJENT.
Yeah, that's what they all say.
BTW: STOP SHOUTING AT US.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
-- modified at 22:16 Monday 9th January, 2006
|
|
|
|
|
|
Hi
I am setting up a simple web form, and for some reason, the controls that I have put on the page are not showing properly. I have 3 labels and 3 link buttons. They are set up in a column, one after the other, all aligned along the left edge. However, when I compile, they all show up as labels, and rather than showing up properly, they show up in a row.
I am pretty sure that it is a simple solution, but I'm stumped.
Any help would be appreciated.
Derek
|
|
|
|
|
Are they laid out in a table, do they have <br> tags between them, or did you lay them in a column, but not provide any HTML to make them look that way in the browser ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian
Basically, I dragged and dropped the labels from the control list, then the link buttons. In the form layout, they show as 6 controls in 1 column, no table, no tags. I have never had to use HTML to make them line up before. Whenever I have done this before, the controls have shown up exactly as I placed them in the form layout.
Derek
|
|
|
|
|
The form layout page is crap, you should never use it, especially in VS2003 ( you didn't say which you're using ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
OK< I am using VS 2002. Another thing, the link buttons are just showing up as text, not as a link. Any ideas ?
|
|
|
|
|
Sorry for the multiple post, but this is how the page shows up
Assignment 4 Inventory System Derek Gruenthaler Products Product Sales Employees
The following are labels : Assignment 4, Inventory System, Derek Gruenthaler
The following are supposed to be link buttons : Products, Product Sales, Employees
I'm lost here
-- modified at 1:28 Tuesday 10th January, 2006
|
|
|
|
|
First of all, NEVER EVER use the design view again. In fact, you should change the defaults so you never SEE the design view again. The design view on 2002 is crap, it makes a total mess of your HTML, sometimes to the point of breaking it.
Secondly, for a link button to show as a link, you need to set it's target or click event. If you've not set these, they show as plain text ( because they don't know where to link to ). Finally, add that <br/> tag between your labels, and they will show up in a column instead of a row. Tables are the most obvious way to align your stuff on a page, but <br> will work for one column. Also, I believe it's better to use divs, spans and css, but to be honest, I have no idea how that is done.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Give me a latest code in visual basic 6.0 to devlope a mobile application
sandip
|
|
|
|
|
Welcome to Code Project. I see you're new, and this may well be the most English you've spoken in a single day. So, I'll be polite.
What you've posted is a demand. What I think you wanted to do is ask a question.
And furthermore, MSDN is full of samples to answer this sort of generic question. You should ask here when you have a specific problem.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello!
I am developing a cutom module in DotNetNuke.
I have written the correct NameSpace and Assemblyname but I
just keep getting this error in Visual Studio.
Errormessage:
"An unhandled exception of type 'System.MemberAccessException' ocurred
in mscorib.dll
Additional information: Cannot Create an abstract class."
Exception:
System.TypeInitializationException
----Inner exception: System.MemberAccessException
----Message: "Cannot create an abstract class."
----Source: mscorlib
Code:
Imports System<br />
Imports System.Web.Caching<br />
Imports System.Reflection<br />
<br />
Namespace INVID.DNN.Modules.HelloWorld.Data<br />
<br />
Public MustInherit Class DataProvider<br />
<br />
#Region "Shared/Static Methods"<br />
' singleton reference to the instantiated object <br />
Private Shared objProvider As DataProvider = Nothing<br />
<br />
' constructor<br />
Shared Sub New()<br />
CreateProvider()<br />
End Sub<br />
<br />
' dynamically create provider<br />
' This sub gets called, It is calling the methods that will raise the exception<br />
Private Shared Sub CreateProvider() <br />
objProvider = CType(Framework.Reflection.CreateObject( _<br />
"data", _<br />
"INVID.DNN.Modules.HelloWorld.Data", _<br />
"INVID.DNN.Modules.HelloWorld"), DataProvider)<br />
End Sub<br />
<br />
' return the provider<br />
Public Shared Shadows Function Instance() As DataProvider<br />
Return objProvider<br />
End Function<br />
#End Region<br />
End Class<br />
End Namespace
Code that is called in (The Step were it goes wrong) Components\Shared\Reflection.vb:
' dynamically create an object from a TypeName using a CacheKey<br />
Public Shared Function CreateObject(ByVal TypeName As String, _<br />
ByVal CacheKey As String) As Object<br />
<br />
If CacheKey = "" Then<br />
CacheKey = TypeName<br />
End If<br />
<br />
' use the cache for performance<br />
Dim objType As Type = CType(DataCache.GetCache(CacheKey), Type)<br />
<br />
' is the type in the cache?<br />
If objType Is Nothing Then<br />
Try<br />
' use reflection to get the type of the class<br />
objType = Type.GetType(TypeName, True)<br />
' insert the type into the cache<br />
DataCache.SetCache(CacheKey, objType)<br />
Catch exc As Exception<br />
' could not load the type<br />
LogException(exc)<br />
End Try<br />
End If<br />
' dynamically create the object<br />
Return Activator.CreateInstance(objType) ' This line raises the error mentioned before<br />
End Function
Any help on this error will be much appreciated!
Best regards rob_pro@hotmail.com
|
|
|
|
|
I think the error is perfectly clear. You're trying to create an instance of an abstract class. Abstract classes (MustInherit in VB) must be inherited by another class that provides the implementation code.
You declared your Data class abstract yourself with this line:
Namespace INVID.DNN.Modules.HelloWorld.Data
Public MustInherit Class DataProvider
#Region "Shared/Static Methods"
' singleton reference to the instantiated object
Private Shared objProvider As DataProvider = Nothing
If you want your Data class (bad choice of name too) to be created as a concrete class on its own, you have to get rid of the MustInherit keyword.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 13:55 Sunday 8th January, 2006
|
|
|
|
|
Actually i somewhat tried to make the SqlDataProvider class (SqlDataprovider.vb) abstract (MushInherit) which i discovered later.
Of course i cannot create an abstract class of SqlDataProvider with Reflection. I guess i was tired when i was coding!
Thanks for answering very fast!
|
|
|
|
|
The code here appears to be that produced by the code generator when you create a DNN Module project in Visual Studio. The class is abstract because you are supposed to inherit from it with the concrete code to access the specific database that you need. This design is because many modules in DNN are released that can use multiple back end databases and the abstract class provides a way for the module to talk to the database without actually knowing what database it is talking to.
There is will also be a DataPovider project which you add to accompany your module project. The DataProvider project contains the code for a concrete implementation to a single database - this leaves you free to provide as many data providers as there are databases that you wish to support.
Although I use DotNetNuke I am not an expert with it - You might find that the best place to ask a question on it is on their official forums http://forums.asp.net/90/ShowForum.aspx[^] The forum stickies also point you to various documentation on the subject. There are also books on DotNetNuke which you may like to read.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hello!
I have bought both books on DotnetNuke 3.0 to help me with this project.
"Building Websites with VB.NET and DotNetNuke 3.0"
and...
"Professional DotNetNuke ASP.NET Portals".
...which I find most interesting!
Thank you very much with answering my question very fast!;)
|
|
|
|