
farshad
Avatar/Signature-
Posts
114 -
Joined
-
Last visited
Everything posted by farshad
-
Hi, Yes, I am running it repeatedly. I can not close it in the above code because then I will not be able to loop through that sqldatareader function
-
Hi, in a class module, this is how I am retrieving data. Public Function GetAllCollectionsForParent(ByVal intParentID As Integer) As SqlDataReader Dim strSQL As String = "CSA_SP_GetAllStrategiesParentCollections" Dim oCon As SqlConnection Dim oCmd As SqlCommand Try oCon = New SqlConnection(ConnectToDB) oCmd = New SqlCommand(strSQL, oCon) With oCmd .CommandType = CommandType.StoredProcedure .Parameters.Add("@StrategyParentID", SqlDbType.Int, 4) .Parameters("@StrategyParentID").Value = intParentID oCon.Open() Return .ExecuteReader(CommandBehavior.CloseConnection) End With Catch ex As Exception Throw ex End Try End Function In the form module I then use a datareader to loop through the above records... After about 300 records i receive an error message saying something about the connection pool may have reached its limit. Any thoughts? Thanks
-
Hi, Using VB.NET how is it possible to change the colour of the cells (NOT the texts in the cell) of a row or an individual cell in excel. Thanks
-
This is my code to retrive values based on an input parameter (see below) Public Function GetAllCollectionsForParent(ByVal intParentID As Integer) As SqlDataReader Dim strSQL As String = "SP_Name" Dim oCon As SqlConnection Dim oCmd As SqlCommand Try oCon = New SqlConnection(ConnectToDB) oCmd = New SqlCommand(strSQL, oCon) With oCmd .CommandType = CommandType.StoredProcedure .Parameters.Add("@StrategyParentID", SqlDbType.Int, 4) .Parameters("@StrategyParentID").Value = intParentID oCon.Open() Return .ExecuteReader(CommandBehavior.CloseConnection) End With Catch ex As Exception Throw ex End Try End Function The problem is that when I run the stored procedure "SP_Name" in the query analyser and pass a parameter then it returns data but when in immediate window running ?GetAllCollectionsForParent 1 then it gives this message "Invalid attempt to read when no data is present" Any thoughts? Thanks
-
Hi, I would like to call a com component (i.e a dll which is created in .net) from another program i.e. an excel VBA. How is it possible to create a dll in .net? Thanks
-
I have placed a datagrid on a webform. Asigned several bound columns and button columns. In design mode, the datagrid has the ones I have added as well as column0, column1, column2 which i do not want. These extra columns are just repeat of some of the ones I have added. How can I delete these columns. p.s. they do not appear in the propertybuilder Thanks
-
Hi, It will be helpful to get your ideas on the following: I am supposed to start a project which will basically involve doing a search and then drill down into that search and then further drill down into that second search. My thoughts are using a TreeView control in vb.net using windows application. So, should I do this in windows or should I do this project in asp.net using vb.net? I believe using a TreeView in asp.net is not easy. what do u think? if u recommend doing this project in asp.net, then what shall I use as an alternative to the treeview control, i.e. several datagrids, etc...? Thanks guys
-
Hi, Do u have an example for me to be able to double click a win datagrid and pick up the values in the cells for that row Thanks
-
In vb.net i am running a stored procedure in sql server 2000 the SP is something like: @Curve int . . . @Qualifier varchar(3) = NULL AS select * from table1 where curve=@Curve . . . AND Qualifier = @Qualifier Basically the question is that when i run the query like select * from table1 where Qualifier IS NULL it works and returns data but in SP when no @Qualifier is passed then it becomes select * from table1 where Qualifier = NULL when it is = null it does not return data and thoughts? thanks
-
A win datagrid is populated by a dataset. This dataset varies for each population. i.e sometimes 4 fields and sometimes more or less... I would like to transfer this dataset and populate it into excel sheet. How can a dataset or the data in a datagrid be transfered into excel sheet. If I was using a DataReader I know how to loop through it and populate the excel sheet but with the Dataset I do not know Thanks
-
if a win datagrid is populated using a dataset, then how is it possible to check if there are rows in that datagrid? Thanks
-
can a datareader be assigned to the datasource of a win datagrid? if not then how can i pass sql stored procedures parameters to a dataset? Thanks
-
I have a combo box which I would like to populate when the user enters a few characters in it and then presses enter or something similar. what is the best way to do this please? Thanks
-
running cboTerm.Items.Add(oDR.Item("Term")) produces the error: System.IndexOutOfRangeException ps. the field Term is an Integer field in sql server 2000. any ideas please? Thanks
-
I am using windows security to connect to sql server. what is the connectionstring that I can use so that a connection can be established based on the user having already logged into windows xp? p.s I do not want to use this as it is for a user which has a login in the sql server. "Server=SVR07;Database=servername;User ID=TestUsers;Password=12345678" Thanks
-
does anyone know of a good link or an example to learn on how to create a chart in excel(using the values in the cells of a sheet) using vb.net ? Thanks
-
I have converted my vb6 code to vb.net which creates a chart in excel. Now I have copied this bit of the converted code and pasted it into an existing .net project. Is this a valid thing to do? i.e can you copy a converted code from vb6 to vb.net and paste it into an existing vb.net project? Thanks
-
Hi, to get the .avi to work there is only one problem right now and wonder if you can see what it is. In this button event as follows the error is reported as: pause is not a member of system.windows.forms.control.controlcollection the same error is reported for play and stop this is the code Thanks Private Sub btnPlayPause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlayPause.Click Select Case player.playState Case WMPPlayState.wmppsPlaying player.Controls.pause() Case WMPPlayState.wmppsPaused player.Controls.play() Case WMPPlayState.wmppsStopped player.Controls.play() End Select End Sub
-
Can you convert this vb 6 code to vb.net 2003 ? I tried it but the system can not upgrade the picturebox Thank you Dim sFileName As String, resID As Long, ret As Boolean Picture1.Cls Command1.Enabled = False Command3.Enabled = True If Option1(0).Value = True Then sFileName = Text1.Text: resID = 0 Else sFileName = "Shell32.dll": resID = Mid(Combo1.List(Combo1.ListIndex), 10) End If If Option2(0).Value = True Then ret = PlayAviCtrl(Picture1.hWnd, sFileName, resID, Check1.Value, Check2.Value, Check3.Value) Else ret = PlayAviMCI(Picture1.hWnd, sFileName, resID, Check1.Value, Check2.Value, False) End If If ret = False Then Picture1.Print "Unable to play this AVI" Command3_Click End If
-
The following code downloads particular files from a website. How can I download all files in a particular folder in that web site? Thanks Dim strURL As String = "http://www.test.com/images/" Dim strFileName() As String = {"image1.jpg", "image2.gif"} Dim strFullPath As String Dim wc(1) As WebClient For i As Integer = 0 To 1 wc(i) = New WebClient strFullPath = strURL & strFileName(i) wc(i).DownloadFile(strFullPath, "C:\test\Net\VB\Windows\" & strFileName(i)) wc(i).Dispose() Next
-
download With the help of someone on this site I have managed to download specific files from a web site and save them on the local machine. But now I would like to loop through the folder in the website and one by one collectthe files and on each loop upload the files Thanks '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' This bit of code downloads specific files from a website to the local machine Dim strURL As String = "http://www.test.com/images/" Dim strFileName() As String = {"image1.jpg", "image2.gif"} Dim strFullPath As String Dim wc(1) As WebClient For i As Integer = 0 To 1 wc(i) = New WebClient strFullPath = strURL & strFileName(i) wc(i).DownloadFile(strFullPath, "C:\Farshad\Net\VB\Windows\" & strFileName(i)) wc(i).Dispose() Next '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' This bit of code gets all the files in a folder on the local machine... Dim d() As String d = System.IO.Directory.GetFiles("C:\Farshad\Net\VB\Files\") Dim en As System.Collections.IEnumerator en = d.GetEnumerator While en.MoveNext Console.WriteLine(CStr(en.Current)) End While ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
With the help of someone on this site I have managed to download specific files from a web site and save them on the local machine. But now I would like to loop through the folder in the website and one by one collectthe files and on each loop upload the files Thanks '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' This bit of code downloads specific files from a website to the local machine Dim strURL As String = "http://www.test.com/images/" Dim strFileName() As String = {"image1.jpg", "image2.gif"} Dim strFullPath As String Dim wc(1) As WebClient For i As Integer = 0 To 1 wc(i) = New WebClient strFullPath = strURL & strFileName(i) wc(i).DownloadFile(strFullPath, "C:\Farshad\Net\VB\Windows\" & strFileName(i)) wc(i).Dispose() Next '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' This bit of code gets all the files in a folder on the local machine... Dim d() As String d = System.IO.Directory.GetFiles("C:\Farshad\Net\VB\Files\") Dim en As System.Collections.IEnumerator en = d.GetEnumerator While en.MoveNext Console.WriteLine(CStr(en.Current)) End While ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''