Issuel with querie from SQL Server.

  • Thread starter Thread starter Marcos Bolivar
  • Start date Start date
M

Marcos Bolivar

Guest
Hello Team. I would like to say thank you for all your support.

This is my point:

I have a decimal value in SQLServer and I'm trying to bring this value to VB.net, but only I got the integer part no the decimal part. so please I need your help. I tried everything but nothing. The following in my code in VB.net:








PublicFunctionFnt_Totaltransfer(OptionalqueryI AsString= "") AsDecimal








' Dim SqlException As String








Try








Usingconnection = getconnection()







UsingCommand = NewSqlCommand()


Command.Connection = connection

Command.CommandText = queryI

Command.CommandType = CommandType.Text

connection.Open()

recorcount = Convert.ToDecimal(Command.ExecuteScalar())






EndUsing








EndUsing








Catchex AsSqlException


MsgBox(ex.Message)






Finally








Ifconnection.State = ConnectionState.Open Thenconnection.Close()







EndTry








Returnrecorcount







EndFunction




MB

Continue reading...
 
Back
Top