why the @#$@% does this code not work 
Author Message
 why the @#$@% does this code not work

Imports System
Imports System.Web.UI
Imports System.Data
Imports System.Data.SqlClient

Namespace dude
    Public Class master

        Inherits Control
        Inherits DataSet

        Protected Overrides Sub Render(writer As HtmlTextWriter)
            writer.Write("<B>joepie</b>")
        End Sub

        Function kweerie() As System.Data.DataSet
            Dim connectionString As String = "server='myServer'; user
id='sa'; password='emptyoffcourse'; Database='myTabel'"
            Dim sqlConnection As SqlConnection = New
SqlConnection(connectionString)

            Dim queryString As String = "SELECT [myProject].* FROM
[mYProject]"
            Dim sqlCommand As SqlCommand = New SqlCommand(queryString,
sqlConnection)

            Dim dataAdapter As SqlDataAdapter = New
SqlDataAdapter(sqlCommand)
            Dim dataSet As DataSet = New DataSet
            dataAdapter.Fill(dataSet)

            Return dataSet
        End Function

   End Class
End Namespace



Tue, 03 May 2005 02:36:26 GMT  
 why the @#$@% does this code not work
I think you cant have multiple inheritance

Quote:
>-----Original Message-----
>Imports System
>Imports System.Web.UI
>Imports System.Data
>Imports System.Data.SqlClient

>Namespace dude
>    Public Class master

>        Inherits Control
>        Inherits DataSet

>        Protected Overrides Sub Render(writer As
HtmlTextWriter)
>            writer.Write("<B>joepie</b>")
>        End Sub

>        Function kweerie() As System.Data.DataSet
>            Dim connectionString As String

= "server='myServer'; user

- Show quoted text -

Quote:
>id='sa'; password='emptyoffcourse'; Database='myTabel'"
>            Dim sqlConnection As SqlConnection = New
>SqlConnection(connectionString)

>            Dim queryString As String = "SELECT
[myProject].* FROM
>[mYProject]"
>            Dim sqlCommand As SqlCommand = New SqlCommand
(queryString,
>sqlConnection)

>            Dim dataAdapter As SqlDataAdapter = New
>SqlDataAdapter(sqlCommand)
>            Dim dataSet As DataSet = New DataSet
>            dataAdapter.Fill(dataSet)

>            Return dataSet
>        End Function

>   End Class
>End Namespace

>.



Tue, 03 May 2005 02:47:06 GMT  
 why the @#$@% does this code not work
VB.NET does not support Multiple inheritance:

Quote:
>         Inherits Control
>         Inherits DataSet

You must choose one or the other.


Quote:
> Imports System
> Imports System.Web.UI
> Imports System.Data
> Imports System.Data.SqlClient

> Namespace dude
>     Public Class master

>         Inherits Control
>         Inherits DataSet

>         Protected Overrides Sub Render(writer As HtmlTextWriter)
>             writer.Write("<B>joepie</b>")
>         End Sub

>         Function kweerie() As System.Data.DataSet
>             Dim connectionString As String = "server='myServer'; user
> id='sa'; password='emptyoffcourse'; Database='myTabel'"
>             Dim sqlConnection As SqlConnection = New
> SqlConnection(connectionString)

>             Dim queryString As String = "SELECT [myProject].* FROM
> [mYProject]"
>             Dim sqlCommand As SqlCommand = New SqlCommand(queryString,
> sqlConnection)

>             Dim dataAdapter As SqlDataAdapter = New
> SqlDataAdapter(sqlCommand)
>             Dim dataSet As DataSet = New DataSet
>             dataAdapter.Fill(dataSet)

>             Return dataSet
>         End Function

>    End Class
> End Namespace



Tue, 03 May 2005 04:25:53 GMT  
 why the @#$@% does this code not work
You can however implement multiple interfaces.  Of coarse you need to
implement your own code for interface members.

Alternatively, create a new control class inherited from Control.  Then
create a private field of type DataSet.  Then create public members that
expose the desired DataSet members.


Quote:
> VB.NET does not support Multiple inheritance:

> >         Inherits Control
> >         Inherits DataSet

> You must choose one or the other.



> > Imports System
> > Imports System.Web.UI
> > Imports System.Data
> > Imports System.Data.SqlClient

> > Namespace dude
> >     Public Class master

> >         Inherits Control
> >         Inherits DataSet

> >         Protected Overrides Sub Render(writer As HtmlTextWriter)
> >             writer.Write("<B>joepie</b>")
> >         End Sub

> >         Function kweerie() As System.Data.DataSet
> >             Dim connectionString As String = "server='myServer'; user
> > id='sa'; password='emptyoffcourse'; Database='myTabel'"
> >             Dim sqlConnection As SqlConnection = New
> > SqlConnection(connectionString)

> >             Dim queryString As String = "SELECT [myProject].* FROM
> > [mYProject]"
> >             Dim sqlCommand As SqlCommand = New SqlCommand(queryString,
> > sqlConnection)

> >             Dim dataAdapter As SqlDataAdapter = New
> > SqlDataAdapter(sqlCommand)
> >             Dim dataSet As DataSet = New DataSet
> >             dataAdapter.Fill(dataSet)

> >             Return dataSet
> >         End Function

> >    End Class
> > End Namespace



Wed, 04 May 2005 01:16:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Why does the following code not work?

2. this code does not work, why?

3. Help Please...Code does not work why?

4. Why code will not work?

5. Why does this piece of code work with Word 97 but not Word 2000

6. why will this code not work

7. Find/Replace code not working - why?

8. Why this code does not work:

9. Anyone know why this code only works in 32bit and not 16 bit vb 4

10. Why this code does not work properly?

11. Why does this code not work?

12. Why does this simple code not work?

 

 
Powered by phpBB® Forum Software