MATLAB:CONNECTING DB WITH MATLAB AND DOTNET

.NET

import System.Data.SqlClient.*
NET.addAssembly('System.Data');
conn = SqlConnection('Data Source=.;Initial Catalog=Canteen;Integrated Security=true;');
conn.Open();
q = SqlCommand('select * from [Order]', conn);
r = q.ExecuteReader();
while r.Read()
char(r.GetString(1))
end
r.Close()
conn.Close()

For connecting with Java,follow this link:

https://stackoverflow.com/questions/6593485/how-to-connect-to-microsoft-sql-server-2008-mssql-from-matlab/

Leave a Reply

Your email address will not be published. Required fields are marked *