Click here to Skip to main content
15,896,154 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Ms Access Data Updation using VB.Net Pin
Dave Kreskowiak9-Feb-06 3:02
mveDave Kreskowiak9-Feb-06 3:02 
GeneralRe: Ms Access Data Updation using VB.Net Pin
mayhem_rules10-Feb-06 0:18
mayhem_rules10-Feb-06 0:18 
Questionusing DVP1412.dll in VB.NET Pin
bskirkman7-Feb-06 17:44
bskirkman7-Feb-06 17:44 
QuestionHow to remove this Office COM Add-in Pin
cylix20007-Feb-06 17:31
cylix20007-Feb-06 17:31 
QuestionProblem on changing recordset to dataset Pin
drexler_kk7-Feb-06 17:14
drexler_kk7-Feb-06 17:14 
AnswerRe: Problem on changing recordset to dataset Pin
alien viper7-Feb-06 21:37
alien viper7-Feb-06 21:37 
GeneralRe: Problem on changing recordset to dataset Pin
drexler_kk7-Feb-06 22:14
drexler_kk7-Feb-06 22:14 
AnswerRe: Problem on changing recordset to dataset Pin
Guffa7-Feb-06 22:36
Guffa7-Feb-06 22:36 
I removed some unused code, and converted it. It's pretty close to your original code and quite straightforward, so you should be able to follow it.

Private Sub Spam_Now()
	Dim conStr1 As String
	Dim con1 As SqlConnection
	Dim reader As IDataReader
	Dim sql1 As String
	Dim command As SQlCommand

	conStr1 = "provider=SQLOLEDB;data source=" & DellServerIP _
	& ";database=pre_sms;uid=sa;pwd=" & DellServerPass

	con1 = New SqlConnection(conStr1)

	sql1 = "SELECT TOP 20 Mobile_No FROM TT_Member WHERE Reminder = '0' AND Status = '1'"

	command = New SqlCommand(sql1, con1)
	reader = command.ExecuteReader()

	If not reader.Read() Then
		Label1.Caption = "Finished - " & Now
	Else
		Do
			Label1.Caption = "Spamming - " & Now

			OriginatingAddress = reader.GetString("Mobile_No")
			If OriginatingAddress.Substring(0, 3) = "601" Then
				Telco = 2
			ElseIf OriginatingAddress.Substring(0, 3) = "019" Then
				Telco = 9
			End If

			Reminder_Msg = "Free Msg.Subscription Reminder.Fee:Auto renewal datedate, unless cancelled. To cancel, send STOP TT to 32132."

			MT_Msg = Reminder_Msg
			MT_Msg = Replace(MT_Msg, "datedate", Renewal_Date3)

			Call Sent_MT()
			Call Close_Record()

		Loop Until not reader.Read()
	End If

End Sub


One difference between a Recordset and a DataReader that can be good to know, is that you use the Read() method to both advance the row pointer and check for more rows, just like you use MoveNext() and EOF with a recordset. Also you have to call Read() before you can read any data from the DataReader, it doesn't automatically read the first record as a Recordset does.

---
b { font-weight: normal; }

GeneralRe: Problem on changing recordset to dataset Pin
drexler_kk8-Feb-06 20:48
drexler_kk8-Feb-06 20:48 
QuestionHELP! How to convert msaccess bitmap image to long binary format??? Pin
isgrom7-Feb-06 13:22
isgrom7-Feb-06 13:22 
AnswerRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Mekong River7-Feb-06 14:53
Mekong River7-Feb-06 14:53 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
isgrom8-Feb-06 5:51
isgrom8-Feb-06 5:51 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Dave Kreskowiak8-Feb-06 7:56
mveDave Kreskowiak8-Feb-06 7:56 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
isgrom8-Feb-06 9:06
isgrom8-Feb-06 9:06 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Dave Kreskowiak8-Feb-06 11:35
mveDave Kreskowiak8-Feb-06 11:35 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Mekong River9-Feb-06 20:18
Mekong River9-Feb-06 20:18 
QuestionCopy data from Datagrid to form Pin
Jlawrnce7-Feb-06 10:54
Jlawrnce7-Feb-06 10:54 
AnswerRe: Copy data from Datagrid to form Pin
Jlawrnce7-Feb-06 11:53
Jlawrnce7-Feb-06 11:53 
GeneralRe: Copy data from Datagrid to form Pin
Jlawrnce7-Feb-06 13:56
Jlawrnce7-Feb-06 13:56 
QuestionSorry now in english => system.UnauthorizedAccessException during access on system directory Pin
cosma2177-Feb-06 10:28
cosma2177-Feb-06 10:28 
AnswerRe: Sorry now in english => system.UnauthorizedAccessException during access on system directory Pin
Guffa7-Feb-06 11:13
Guffa7-Feb-06 11:13 
GeneralRe: Sorry now in english => system.UnauthorizedAccessException during access on system directory Pin
cosma2177-Feb-06 11:22
cosma2177-Feb-06 11:22 
AnswerThe system directory is protected by the OS Pin
JUNEYT8-Feb-06 0:31
JUNEYT8-Feb-06 0:31 
GeneralRe: The system directory is protected by the OS Pin
cosma2178-Feb-06 4:46
cosma2178-Feb-06 4:46 
GeneralRe: The system directory is protected by the OS Pin
JUNEYT8-Feb-06 5:03
JUNEYT8-Feb-06 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.