Jump to content
Xtreme .Net Talk

Robby

Moderators
  • Posts

    3848
  • Joined

  • Last visited

Everything posted by Robby

  1. here's one way to step through the Dataset and find or change something... Dim SelRow As Integer For SelRow = DataSet1.Tables(0).Rows.Count() - 1 To 0 Step -1 'do stuff here Next
  2. You are Opening a connection but Closing a Datareader and a Command. And use a For loop inside If myDataReader.Read Then, you should just do While myDataReader.Read (no IF), it will exit the loop when it hits EOF. Also if you're going to put another New Connection inside the Catch, you should nest another Try/Catch in there.
  3. Did you read what wyrd and I had to say?
  4. In the Solution Explorer...Hit the + sign next to References to expand... Right-click on the reference you would like to remove and select Remove (or Delete) from the context menu.
  5. You can use Crystal Reports or this method .... http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69464&highlight=print You can find a Crystal sample here http://msdn.microsoft.com/vbasic/downloads/samples/default.asp
  6. James, one thing you may consider is, instead of using the TextChanged event maybe use the Leave Event. As the user may want to enter the month in words, ie. Feb 2 2003
  7. As Derek mentioned it wouldn't be practical in Access. But you can can still create/use Stored Proc in Access.... Private Sub ProductsProcs() Dim sSQL As String ' procProductsList - Retrieves entire table sSQL = "CREATE PROC procProductsList AS SELECT * FROM Products;" CreateStoredProc(sSQL) ' procProductsDeleteItem - Returns the details (one record) from the JobTitle table sSQL = "CREATE PROC procProductsDeleteItem(inProductID LONG) " & _ "AS DELETE FROM Products WHERE ProductID = inProductID;" CreateStoredProc(sSQL) ' procProductsAddItem - Add one record to the JobTitle table sSQL = "CREATE PROC procProductsAddItem(inProductName VARCHAR(40), inSupplierID LONG, inCategoryID LONG) " & _ "AS INSERT INTO Products (ProductName, SupplierID, CategoryID) Values (inProductName, inSupplierID, inCategoryID);" CreateStoredProc(sSQL) ' procProductsUpdateItem - Update one record on the JobTitle table sSQL = "CREATE PROC procProductsUpdateItem(inProductID LONG, inProductName VARCHAR(40)) " & _ "AS UPDATE Products SET ProductName = inProductName WHERE ProductID = inProductID;" CreateStoredProc(sSQL) End Sub Private Sub CreateStoredProc(ByVal sSQL As String) Dim con As OleDbConnection Dim cmd As OleDbCommand = New OleDbCommand() Dim da As OleDbDataAdapter Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Northwind.mdb" con = New OleDbConnection(sConStr) cmd.Connection = con cmd.CommandText = sSQL con.Open() cmd.ExecuteNonQuery() con.Close() End Sub
  8. 'even though we start Maximized, this size is for the Restore (un-Maximize) PrintPreviewDialog1.Height = 600 PrintPreviewDialog1.Width = 800 PrintPreviewDialog1.WindowState = FormWindowState.Maximized
  9. Hmm, short of using an array and sorting it that way I don't know how to do it on the client. Sorry. Hold on. Is this an ASP Listbox?
  10. Wow, that site (page) is attempting to run a ton of ActiveX when loading. Or it's stuck in a loop because I disabled ActiveX. Sorry I can't see it. [edit]Oh, the thread has been merged, I guess that I can see it now...[/code]
  11. TechnoTone, that's exactly what I understood.
  12. I posted this in your other thread (PLEASE don't multi-post) Anyway, I didn't want to waste mine... you can use Asc() and add 32 for lower and minus 32 for upper Why don't you use the toUpper
  13. Where is the data coming from, (before it goes into the listbox)
  14. Time will tell. Welcome aboard.
  15. you can use the Add method of the Listbox... Dim cn As New SqlConnection() Dim cmd As New SqlCommand() Dim dr As SqlDataReader cn.ConnectionString = "Data Source=127.0.0.1;Integrated Security=Yes;Initial Catalog=Northwind;Persist Security Info=False" cn.Open() Dim sSQL As String = "SELECT * FROM Orders order by CustomerID" cmd.Connection = cn cmd.CommandText = sSQL cmd.CommandType = CommandType.Text dr = cmd.ExecuteReader(CommandBehavior.Default) Do While dr.Read() ListBox1.Items.Add(dr("CustomerID") & " " & dr("OrderDate")) Loop dr.Close() cn.Close() cmd = Nothing dr = Nothing Here's how you can bind the listbox... The Value Member is usualy your Primary key. Dim ds As New DataSet() Dim sSQL As String = "SELECT CustomerID, (CompanyName + ', ' + Address) AS NewName FROM Customers order by CustomerID" Dim sConn As String = "Data Source=127.0.0.1;Integrated Security=Yes;Persist Security Info=False;Initial Catalog=Northwind;" Dim da As New SqlClient.SqlDataAdapter(sSQL, sConn) da.Fill(ds, "Orders") ListBox2.DataSource = ds.Tables(0) ListBox2.DisplayMember = "NewName" ListBox2.ValueMember = "CustomerID"
  16. When you assign your context menu to the textbox it should override the default one.
  17. You don't need the //localhost or URL, all you need is the name of you ASPX file (in the sURL)
  18. I don't think that binding to textboxes on a web page is very efficient let allow simple. Consider some options spelled out at this link (look for Data Access, Server-Side Data Access and Data Binding Server Controls) http://samples.gotdotnet.com/quickstart/aspplus/
  19. Sorry, I forgot to ask....On an ASP page right?
  20. Do you want to display the results on a DataGrid or textboxes?
  21. Do you want to resize the form or the label?
  22. Welcome aboard.
  23. Oh yeah, to call it from an <a href>.... "<a href=javascript:fnOpenPopup('" & sURL & "','" & sArgs & strArray(intCounter, 1) & "','" & sFeaturesModeless & "','" & sMode & "')>Some Text</a>"
  24. You can play around with the Features to suite your needs... Dim sURL As String = "Your_Popup.aspx?SomeString=" Dim sArgs As String = "someargsServiceDefinitions" Dim sFeaturesModeless As String = "menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,width=800,height=400" Dim sFeaturesModal As String = "dialogHeight:500px;dialogWidth:500px;dialogTop:100px;dialogLeft:100px;edge:Raised;center:1;help:0;resizable:1;status:0;scroll:1" Dim sMode As String = "Modal"
×
×
  • Create New...