Click here to Skip to main content
15,899,314 members

Comments by vivianpinto (Top 4 by date)

vivianpinto 21-Nov-16 0:45am View    
Hi Morphe

Thanks for the response.

my query is simple, The location column do not have indexing.

Select * from dqc342 Where Location= 'A9T80-60008 ' and TEST_DTTM between to_date('20161121000000','yyyymmdd hh24miss') and to_date('20161121 235959','yyyymmdd hh24miss')



I have a question. How I stop this query when user want to abort.
vivianpinto 16-Jul-16 0:34am View    
Thank you Bernhard Hiller,

I am not familiar with C#

I am looking vb.net solution.

Thank you
vivianpinto 11-Jan-16 20:50pm View    
Thank you Damit

It gives me the same list even if i comment the sql command querry. this is strange.
Am I wrong in my code at looping.? why it gives me result even if comment the sql querry?

<pre lang="C#">Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sqlConn As New SqlClient.SqlConnection("Data Source=C8067;Initial Catalog=msdb;Integrated Security=True")
sqlConn.Open()

'Dim cmd As New SqlClient.SqlCommand("SELECT sobjects.name FROM sysobjects sobjects WHERE sobjects.xtype = 'U'", sqlConn)
Dim dsColumns As New DataSet
Dim daAdapter As New SqlClient.SqlDataAdapter(cmd)

daAdapter.Fill(dsColumns)
If dsColumns.Tables(0).Rows.Count > 0 Then
ListBox1.Items.Clear()
For i As Integer = 0 To dsColumns.Tables(0).Rows.Count - 1
ListBox1.Items.Add(dsColumns.Tables(0).Rows(i)(0).ToString())


Next
Else
MessageBox.Show("Tables not found.")
End If
sqlConn.Close()
vivianpinto 4-Jan-16 22:59pm View    
Hi Abhinav.

Thank you very much for quick response.

I did not present my question properly sorry for that.

What actually i want is SQL Move first, move next Move last Move previous operation.

I am beginning with Move next operation, so i am giving a try for 5 records.

You are exactly right. the loop is running on every record.

i want only one increment in "i" every time the button is pressed.


Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click
Dim sqlconn As New SqlClient.SqlConnection

sqlconn.ConnectionString = "Data Source=C8067;Initial Catalog=msdb;Integrated Security=True"
sqlconn.Open()
Dim da As New SqlDataAdapter("select * from regions", sqlconn)
Dim ds As New DataSet
da.Fill(ds)d


For i As Integer = ( index of current record) To (end of record)

txtRegion_ID.Text = ds.Tables(0).Rows(i).Item(0).ToString
txtRegion_Name.Text = ds.Tables(0).Rows(i).Item(1).ToString
If reaching last record msg box" end of record"
End If
Next

sqlconn.Close()

End Sub

Thank you.