CrazyEngineers
  • SQL and .NET connectivity problem

    Updated: Oct 18, 2024
    Views: 1.0K
    Hi guys,

    I am making ma project of Hospital managent system using C# as well as .NET in frontend and SQL server 2005 at backend.
    The problem is when I made my connection from the .NET to SQL for accessing particular database on my personal pc that connection is not working in other pc, means I am not able to retrive particular data from DATASET.

    I am using ADO.Net for connectivity.(I edit ma connection string and change server name but problem is still there) 😕
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • CEMember

    MemberJul 6, 2009

    Hi Heart-hacker 😀


    Are you sure that connection is working when not used in .NET framework. I mean tables and connections are already created and working correctly in SQL Server ? Did you create OleDBConnection object in code. ?

    Is it possible for you share the code[atleast ConnectionString part] here so that we can get an idea to detect the error in it.
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberJul 6, 2009

    CEMember
    Hi Heart-hacker 😀


    Are you sure that connection is working when not used in .NET framework. I mean tables and connections are already created and working correctly in SQL Server ? Did you create OleDBConnection object in code. ?

    Is it possible for you share the code[atleast ConnectionString part] here so that we can get an idea to detect the error in it.

    Thanks for quick reply....

    Yes its working properly in SQL server... I can use all DDL and DML statements perfectly
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberJul 6, 2009

    Here it is my CONNECTION STRING >>>>> Data Source=ACD-2C0EEE85F9C;Initial Catalog=LIFELINE_HMS;Integrated Security=True


    Dude I am using ADO.NET for connection not OLEDB
    Are you sure? This action cannot be undone.
    Cancel
  • CEMember

    MemberJul 7, 2009

    HEART-HACKER
    Yes its working properly in SQL server... I can use all DDL and DML statements perfectly
    That's cool 😀

    HEART-HACKER
    Here it is my CONNECTION STRING >>>>> Data Source=ACD-2C0EEE85F9C;Initial Catalog=LIFELINE_HMS;Integrated Security=True


    Dude I am using ADO.NET for connection not OLEDB
    Sorry for that as I have lost touch of all these things but as no CEan yet replied to your query so just made an attempt to help you out. Anyways, are you sure, you have set the correct values in your Connection String ?

    I guess if database is created in your system only then Data Source = (local). What is this "ACD-2C0EEE85F9C" ?
    LIFE_LINE_HMS
    is your Database's name right? Well, no user names and passwords for your database right?

    Check your data source once again. Also can check following link for more information, if can be of any help to you.
    #-Link-Snipped-#

    All the Best ! 😀
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberJul 8, 2009

    CEMember
    That's cool 😀



    Sorry for that as I have lost touch of all these things but as no CEan yet replied to your query so just made an attempt to help you out. Anyways, are you sure, you have set the correct values in your Connection String ?

    I guess if database is created in your system only then Data Source = (local). What is this "ACD-2C0EEE85F9C" ?
    LIFE_LINE_HMS is your Database's name right? Well, no user names and passwords for your database right?

    Check your data source once again. Also can check following link for more information, if can be of any help to you.
    #-Link-Snipped-#

    All the Best ! 😀

    Data Source = (local) means Our LOCAL SERVER means your PC NAME.

    "ACD-2C0EEE85F9C" is my LOCAL SERVER NAME
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberJul 8, 2009

    Thanks for the link......
    Are you sure? This action cannot be undone.
    Cancel
  • easels

    MemberJul 17, 2009

    HEART-HACKER
    Hi guys,

    I am making ma project of Hospital managent system using C# as well as .NET in frontend and SQL server 2005 at backend.
    The problem is when I made my connection from the .NET to SQL for accessing particular database on my personal pc that connection is not working in other pc, means I am not able to retrive particular data from DATASET.

    I am using ADO.Net for connectivity.(I edit ma connection string and change server name but problem is still there) 😕
    hey buddy the database problem is not new . i personnally have not tried running the exe application in other computer and it runs well.you can try is copy the database in debug folder of the project and put the connection string as application.startpath which is were the exe is kept
    if it does not corrects then post it i will try another way
    Are you sure? This action cannot be undone.
    Cancel
  • easels

    MemberJul 17, 2009

    hey buddy the database problem is not new . i personnally have not tried running the exe application in other computer and it runs well.you can try is copy the database in debug folder of the project and put the connection string as application.startpath which is were the exe is kept
    if it does not corrects then post it i will try another way
    Are you sure? This action cannot be undone.
    Cancel
  • debu

    MemberJul 17, 2009

    @HEART-HACKER: I agree with easels, try copying your db's *.mdf file in the /bin/debug or /bin/release (whichever you are using) directory. I seem to recall having the same problem in the past, but I can't seem to recall what the cause of the problem was, or how I fixed it 😒.

    I'll keep you updated if something strikes me.

    Regards,

    Debu 😀
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberJul 18, 2009

    easels
    hey buddy the database problem is not new . i personnally have not tried running the exe application in other computer and it runs well.you can try is copy the database in debug folder of the project and put the connection string as application.startpath which is were the exe is kept
    if it does not corrects then post it i will try another way
    I am not getting you.... 😕
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register