1
Answer

SqlConnection...Please help!!

fadil1977

fadil1977

20y
1.9k
1
Hi !! I have a code that runs from a different machine and a different site and i am facing a problem that i can not log in to the database.I installed SQL Server on my machine and I created a user "fadila" and SQL Server Authentication and the password is "fadil1977" and the database is "otters" and it is installed as tables and stored procedures but there is not data on these tables. I used the method provided in the code so, i only change the "connStr" in one place rather than in 20 places and my code is as below. Can you please Help me to connect to the database. I Really..Really appreciate it if you help me to solve it as it causeing me a big head-ache and still get the error message "SQL Server does not exist or access denied" .. please help!!!! Friend Shared ReadOnly Property connStr() As String Get Return String.Format( _ "Data Source={0};Initial Catalog=Otters;User ID=fadila;Password=fadil1977", _ DatabaseMachine) End Get End Property
Answers (1)
2
Midhun T P

Midhun T P

NA 19.7k 281.1k 8y
Hi,<br><br> Do you need to validate a row or column?<br> You can convert to int as below-<br> Convert.ToInt32(dt.Rows[0]["colname"].ToString())>0
Accepted
1
Kishore Chowdary

Kishore Chowdary

NA 12.7k 254.9k 8y
use the string conversion code. the code is as follows
consider it as follows.
int a;
a=Console.ReadLine(int.Parse());
1
Raja

Raja

NA 1.7k 45.2k 8y
1
Pradeep Shet

Pradeep Shet

NA 6.3k 2.1m 8y
hi raja,
This is what you were looknig for?
foreach(DataRow dr in dt.Rows)
{
if(Convert.ToInt32(dr["colname"])>0)
{
//do something
}
}
1
Delpin Susai Raj

Delpin Susai Raj

NA 32k 1m 8y
http://stackoverflow.com/questions/1019793/how-can-i-convert-string-to-int
1
Krishna Rajput Singh

Krishna Rajput Singh

NA 5.5k 2m 8y
Hello Raja thank you for writing below links helpful for your question...........:)
and please clear your question first.....if you not looking that
https://msdn.microsoft.com/en-IN/library/bb397679.aspx
http://stackoverflow.com/questions/1019793/how-can-i-convert-string-to-int
http://sqlserverplanet.com/tsql/convert-text-string-to-numbers-int