Jump to content
Xtreme .Net Talk

bdubon

Members
  • Posts

    10
  • Joined

  • Last visited

bdubon's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yes, I've rebuilt several times... The project in question was taken from a previous solution, and copied to the current solution. I occasionally get a dependency error reported when I get the main build error. The said project does not have any dependecies (it's the last tier!). Don't know if that helps...
  2. Thanks But... I'm not using VSS...There are no other apps that use this project so I don't see that another process is using it!?!. The problem only occurs when I make a change to a class within the project and try to build it.
  3. My VB solution references several sub projects. Whenever I modify a class in one of these projects I get the following error message: "Unable to write to output file .....\obj\Debug\Data Access Tier.dll': System Error &H80070020&". The only work around I've found is to quit VS and manually delete the dll and PDB files in this projects debug folder ie the dll above and its PDB. Can anyone suggest what might be causing these errors and possible fixes?
  4. Is there a better way? I'm trying to benefit from the performance of Datareaders. Could you post some code that returns a datareader? Thanks again
  5. Mocella, FYI, I'm using SQL Server, Stored Procs w/ no parameters. By "..a function that takes your control .." do you mean pass-in the control? I'd prefer to only pass-in the stored proc name and have the function return a populated object to which the listbox/combo could then bind to. Also, to return a datareader, the function "GetDatareader" must be declared as datareader. No? I've tried that but it's not a valid type. FYI, I've been working on a function that will return a DataTable (all new to me!). Here's what it looks like so far: Public Overloads Overrides Function GetDataReader(ByVal storedProcName As String) As DataTable GetDataReader = New DataTable("ListTable") 'Create the connection to the database... Dim cnSQLConnection As New SqlConnection(GenericDataAccessProvider._Dbstring) cnSQLConnection.Open() 'Create the readers command Dim command As New SqlCommand(storedProcName, cnSQLConnection) command.CommandType = CommandType.StoredProcedure command.CommandText = storedProcName 'Create the DataReader object Dim SQLReader As SqlDataReader Try 'Set up the DataTable Dim displayMemberCol As DataColumn = New DataColumn Dim valueMemberCol As DataColumn = New DataColumn With valueMemberCol .DataType = System.Type.GetType("System.Integer") .ColumnName = "Key" End With With displayMemberCol .DataType = System.Type.GetType("System.String") .ColumnName = "Text" End With GetDataReader.Columns.Add(valueMemberCol) GetDataReader.Columns.Add(displayMemberCol) 'Populate the Reader SQLReader = command.ExecuteReader() Do While SQLReader.Read GetDataReader.NewRow() Loop Catch ex As Exception MsgBox("The Following Error Occurred: " & ex.Message, , "Class -MSSQLServer.GetDataReader()") Finally End Try SQLReader.Close() cnSQLConnection.Close() End Function Thanks!
  6. I'm trying to create a generic function to populate listboxes/combos/etc. I want the function to use a DataReader to get the data. The function will reside at the DAL and will be used by ALL listboxes, therefore I can't 'hardcode' a specific control to be populated during the reader.Read step. How should I do this?
  7. One more thing, you need to delete the following "style.GridColumnStyles(0).Width = 150 style.GridColumnStyles(1).Width = 200 style.GridColumnStyles(2).Width = 300"
  8. Burak, You need to declare grid column styles after the style.mappingName statement, eg Dim FirstNameCol As New DataGridTextBoxColumn(). Then set the various properties of the FirstNameCol column style i.e. .Width = 100, etc. Then, add the new column style to the DataGridTableStyle collection using style.GridColumnStyles.Add(FirstNameCol), and so on for each column style needed in the datagrid. Hope this helps
  9. Populate controls using Generic datareader based on stored procedure I'm trying to create a generic function to populate listboxes/comboboxes, that will use a datareader. The datareader will be based on a stored procedure (the sp will be passed into the function - there will be no parameters). What's the best way to populate the controls? I was thinking of making the function return an Arraylist that the controls will bind to. Is there a better/easier way? TIA
×
×
  • Create New...