Click here to Skip to main content
14,921,581 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Richard Deeming12-Apr-21 22:55
mveRichard Deeming12-Apr-21 22:55 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Member 1514832213-Apr-21 0:02
MemberMember 1514832213-Apr-21 0:02 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Richard Deeming13-Apr-21 0:24
mveRichard Deeming13-Apr-21 0:24 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Member 1514832213-Apr-21 0:51
MemberMember 1514832213-Apr-21 0:51 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Richard Deeming13-Apr-21 1:21
mveRichard Deeming13-Apr-21 1:21 
GeneralRe: C# .Net Core error : server error in '/' application Pin
Member 1514832212-Apr-21 23:49
MemberMember 1514832212-Apr-21 23:49 
AnswerRe: C# .Net Core error : server error in '/' application Pin
C0ding_j3ff18-Apr-21 10:54
MemberC0ding_j3ff18-Apr-21 10:54 
Generalsql server, database stored procedure not working with ip address, please help. Pin
Member 1472928712-Apr-21 0:38
MemberMember 1472928712-Apr-21 0:38 
Dear folks.

I am writing a program for connecting sql server database, and populating data from table using a stored procedure. it is working fine when I use the app.config file's data source as the server name, but when I use the server's ip address and port, it is not working. 

it is showing error, stored procedure not found.

My app config's connection string is as below.

<connectionStrings>  
      <clear />  
      <add name="CONNECTION_FLOR"
       providerName="Microsoft.Data.SqlClient"
       connectionString="Data Source=172.142.1.100,1433;User ID=redacted;Password=redacted;Initial Catalog=tempdb;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" />  
      </connectionStrings>

But when I use Data Source by name as Data Source=(localdb)\SubdivprojV13; it is working all good. The problem is with ip address and port. I checked the connection, connection is opening. But showing error as stored procedure not found.


please check my code snippet.

Public Class Form1
    Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("CONNECTION_FLOR").ConnectionString)
    Private Sub BTN_DISPLAY_Click(sender As Object, e As EventArgs) Handles BTN_DISPLAY.Click
        Dim cmd As New SqlCommand With {
            .Connection = connection,
            .CommandType = CommandType.StoredProcedure,
            .CommandText = "SP_DISPLAY"
        }
        cmd.Connection.Open()
        lbl_CONN.Text = "Connected"
        lbl_CONN.ForeColor = Color.Green

        Dim dt As DataTable = New DataTable()
        dt.Load(cmd.ExecuteReader)
        DataGridView1.DataSource = dt
        DataGridView1.Update()

        If connection.State = ConnectionState.Open Then
            connection.Close()
            lbl_CONN.Text = "DisConnected"
            lbl_CONN.ForeColor = Color.Red
        End If
    End Sub
End Class

Any help is highly appreciated. Thanks in advance,.


modified 12-Apr-21 12:09pm.

AnswerRe: sql server, database stored procedure not working with ip address, please help. Pin
Richard Deeming12-Apr-21 2:13
mveRichard Deeming12-Apr-21 2:13 
GeneralRe: sql server, database stored procedure not working with ip address, please help. Pin
Dave Kreskowiak12-Apr-21 4:03
mveDave Kreskowiak12-Apr-21 4:03 
GeneralRe: sql server, database stored procedure not working with ip address, please help. Pin
Richard Deeming12-Apr-21 4:41
mveRichard Deeming12-Apr-21 4:41 
GeneralRe: sql server, database stored procedure not working with ip address, please help. Pin
C0ding_j3ff18-Apr-21 10:55
MemberC0ding_j3ff18-Apr-21 10:55 
QuestionWhy am I getting insufficient parameters supplied Pin
Adrian Rowlands24-Mar-21 9:57
MemberAdrian Rowlands24-Mar-21 9:57 
QuestionRe: Why am I getting insufficient parameters supplied Pin
Eddy Vluggen24-Mar-21 10:35
professionalEddy Vluggen24-Mar-21 10:35 
AnswerRe: Why am I getting insufficient parameters supplied Pin
Dave Kreskowiak24-Mar-21 10:56
mveDave Kreskowiak24-Mar-21 10:56 
AnswerRe: Why am I getting insufficient parameters supplied Pin
Richard Deeming24-Mar-21 22:07
mveRichard Deeming24-Mar-21 22:07 
AnswerRe: Why am I getting insufficient parameters supplied Pin
C0ding_j3ff18-Apr-21 10:56
MemberC0ding_j3ff18-Apr-21 10:56 
QuestionCreating an invoice in Asp.net core Pin
Member 145665206-Mar-21 9:56
MemberMember 145665206-Mar-21 9:56 
AnswerRe: Creating an invoice in Asp.net core Pin
Eddy Vluggen6-Mar-21 10:12
professionalEddy Vluggen6-Mar-21 10:12 
AnswerMessage Closed Pin
12-Apr-21 23:44
professionalluxe design12-Apr-21 23:44 
QuestionEasing the pain of updating code - Excel macros Pin
Roy935-Mar-21 20:36
MemberRoy935-Mar-21 20:36 
AnswerRe: Easing the pain of updating code - Excel macros Pin
Dave Kreskowiak6-Mar-21 5:23
mveDave Kreskowiak6-Mar-21 5:23 
GeneralRe: Easing the pain of updating code - Excel macros Pin
Roy936-Mar-21 8:02
MemberRoy936-Mar-21 8:02 
AnswerRe: Easing the pain of updating code - Excel macros Pin
Mycroft Holmes6-Mar-21 11:14
professionalMycroft Holmes6-Mar-21 11:14 
GeneralRe: Easing the pain of updating code - Excel macros Pin
Roy936-Mar-21 12:56
MemberRoy936-Mar-21 12:56 

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.