Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is an error occured when Im trying to connect to sql server.I set all the things correct as i think.Added the Jtds driver also.but Still getting error.
Please Can Someone give me a solution for this.
Its very urgent Project.
Here is my code.
C#
public Connection conn = null;
    public static final String driver = "net.sourceforge.jtds.jdbc.Driver";
    public static final String connString = "jdbc:jtds:sqlserver://192.168.152.111; DatabaseName=IT_Assets";

String username = "sa";
String password = "123";
conn = DriverManager.getConnection(connString, username,password); <== (I get error in Here..)
Log.w("Connection", "open");
Statement stmt1 = conn.createStatement();
ResultSet c1 = stmt1.executeQuery("select * from Table1");

Please Need a help.
Thanks...
Posted
v2

1 solution

Have a look at this trouble shooting guide[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900