I'm trying to fill a dataset from a dataadapter and I'm getting the
following error.  My SPROC is returning 3 datasets but I want only the
first on to be put into this dataset.   
 
 System.FormatException: Input string was not in a correct format. 
 
Here is my code.
 
' Create Instance of Connection and Command Object
Dim myConnection As New
SqlConnection(ConfigurationSettings.AppSettings("strConn"))

Dim da As New SqlDataAdapter("GetVacationSchedule", myConnection)

da.SelectCommand.CommandType = CommandType.StoredProcedure

da.TableMappings.Add("Employee1", "VacationDates")

da.TableMappings.Add("Employee2", "Vacations")

' Add Parameters to SPROC

Dim parameterYs As New SqlParameter("@ys", SqlDbType.Int, 4)

parameterYs.Value = vYear

da.SelectCommand.Parameters.Add(parameterYs)

Dim parameterDiv As New SqlParameter("@div", SqlDbType.Int, 4)

parameterDiv.Value = div

da.SelectCommand.Parameters.Add(parameterDiv)

Dim parameterDep As New SqlParameter("@dep", SqlDbType.VarChar, 10)

parameterDep.Value = dep

da.SelectCommand.Parameters.Add(parameterDep)

Dim ds As New DataSet

da.Fill(ds, "adUsers")

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'

'The following did't work in the class. It returned the three tables OK,

'but when the dataset was saved to a Session object, and retrieved, the 

'third table was missing the "Clock" column and all subsequent columns.

'Must be a MS bug!!!

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'

'ds.Relations.Add("People", _

' ds.Tables("Employee").Columns("Clock"), _

' ds.Tables("Vacations").Columns("Clock"))

'ds.Relations(0).Nested = True

Return ds

 

This is a function that returns the ds to routine that then populates a
datagrid.  Any help would be greatly appreciated.

Robert

 


This email has been scanned by the Gilman Engineering & Manufacturing, LLC
 Email Security System.


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to