Component Object Model

  • Thread starter Thread starter blackdevil1979
  • Start date Start date
B

blackdevil1979

I need help...
somebody please explain to me what is this COM and how and where to
create a COM class...
 
1. Can MsFlexGrid.net be used in VB.net..?

2. If it is possible.. how to bind the data into it?

3. i received and error when trying to bind in the flexgrid...
error number 13.
description: specified cast not valid..
 
Hi Blackdevil

I almost write the same about using the MsFlexGrid in this newsgroup.

Will the first who succeeded in that tell us how?

Cor
 
Correction in the text

I almost *forever* write the same *text* about using the MsFlexGrid in
*VBNet* in this newsgroup.
 
* (e-mail address removed)-spam.invalid (blackdevil1979) scripsit:
1. Can MsFlexGrid.net be used in VB.net..?

Yes. But like for all other Ax components, it's better to use .NET
replacements instead. The MsFlexGrid can be replaced by the datagrid.
 
I have changed from the flexgrid to datagrid..but somehow i still
cannot see the result.. please look at the code

error stating: Complex DataBinding accepts as a datasourceeither and
Ilistor an IList Source..

HELP




Imports ADODB
Imports System.Data
Imports System.Data.SqlClient

---

Private Sub Form3_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub btnPreview_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnPreview.Click
Try
'Open an ADO Connection
adoCn.Open("Provider=SQLOLEDB.1; Integrated
Security=SSPI;" _
& "Persist Security Info=False; Initial
Catalog=Northwind;" _
& "Data Source=BLACKIE")
'Open an ADO Recordset
adoRs.Open(sql, adoCn, _
ADODB.CursorTypeEnum.adOpenKeyset, _
ADODB.LockTypeEnum.adLockOptimistic, 0)
' fill datagrid
dgReports.DataSource = adoRs
adoCn.Close()
adoRs.Close()
Catch
UnhandledExceptionHandler()
End Try
End Sub
 
Hi Blackdevil,

You are probably upgrading?.

In the most simple format it is with AdoNet as this (typed in this message
so watch typos)

\\\\
dim conn as new SqlClient.SqlConnection("myconnectionString")
dim SqlString as string = "Select * from mytable")
dim ds as new dataset
dim da as new SqlClient.SqlDataAdapter(sqlString, conn)
da.fill(ds)
datagrid1.datasource=ds.tables(0)
///

I hope this helps,

Cor
 
Thanks Cor,

Okay now it can connect.. the problem is that... "there isn't any data
there. All that we
do see is a plus sign (+) in the left portion of the DataGrid"

How to see the whole record..

Dim ds As DataSet = New
DataSet("Recordset")
Dim da As OleDbDataAdapter = New OleDbDataAdapter
Dim dsresults As _Recordset = conn.Execute(sql)
da.Fill(ds, dsresults, "Products")
dgReports.DataSource =
ds.DefaultViewManager

the last time i tried another example... with the code below and it
worked..i tried again.. and now i am here asking for help..
[code:1:84a1b43aee] If
dsresults.Tables("Results").Rows.Count > 0 Then
dgdResults.DataSource = dsdata
dgdResults.DataSource = dsresults
dgdResults.Expand(-1)
dgdResults.NavigateTo(0, "Results")
Else[/code:1:84a1b43aee]
 
Hi Blackdevil,

Why do you need that recordset in between and do you not try that sample I
supplied to you?

You do in my opinion a lot more than is needed. The sample I gave you is
basicly all you have to do, not one commands you are using now extra is
giving you something extra.

What is needed after that is a try, catch and end try, however than you have
readed it. When you want to update it you have to do that as well extra.
What is by the way in a direct way impossible when you use a recordset.

This what you now are doing will give you unpredictable results.

Cor
 
Hello Cor,

It's not I have not tried. I have tried all the simple ones when I
started to know about VB.net. But the problem is now it's not working
with ADODB. Since I am just a beginner...i did look at other examples
as well.. And most of the usage of ADO via COM Interop suggested such
a way... but it's halfway done... until the place where i can see the
'+' sign.
 
Hi Blackdevil,

Why do you want to use ADO(DB) and not ADONET.

ADO (DB) is the previous one which is not from dotNet (You can use it in it,
however you can use almost everything in VBNet.)

As well Com is not really dotNet.

So not to send you away, however when you want to use Com, I think that than
the classic VB newsgroup (VB4,5.6) will give more information as well as the
newsgroup
microsoft.public.data.Ado

When you want to use dotNet with VBNet, than this is the newsgroup to be.

Cor
 
Hi Cor,

If I wanted to use classic VB... i would. BUt like you suspected...yes
I am upgrading. I wouldnt have tried it if the MS VB.net books said
it's not possible, period. So..if it's possible... how to do it?
 
Back
Top