I am getting this error while trying to login to my school managment software.It gives error message when i dont write anything in username and password but when i type correct login details it gives this error
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)

Try adding

";Connection Timeout=60"

to the end of your connection string.

thanks for reply
This errir pops up
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: Login failed for user ''.
and here is connection string.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
  </configSections>
  <connectionStrings>
    <add name="smanagment.My.MySettings.ssoft1_mdfConnectionString"
      connectionString="Data Source=IMTIYAZ-PC\SQLEXPRESS;Initial Catalog=ssoft.mdf;Connection Timeout=60"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
</configuration>

Have you imported the SqlClint ? If not please write Import System.Data.SqlClient at the begining of your module.

From my opinion the connection string structure should be

Data Source=myServerAddress;Initial Catalog=myDataBaseName;Integrated Security=True;

or you can follow this.

Yes i had deleted that integrated security and i also added what revered jim suggested now i dont get errors but form remains still.I does not do anythig
Import System.Data.SqlClient it says declaration needed.
My connection string is now

<connectionStrings>
    <add name="smanagment.My.MySettings.ssoft1_mdfConnectionString"
      connectionString="Data Source=IMTIYAZ-PC\SQLEXPRESS;Database=ssoft.mdf;Integrated Security=True;Connection Timeout=60;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

Got it problem was not in connection neither in code.I actually forgot to write action after successful login.Thanks For Help.Revered Jim and Shark 1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.