Login to DB? No. Actually, NO!!
c# keeps thinking i'm trying login db...i guess. have no password on db; i'll never have password on if live 100 years. db screwing around , experimenting; having fun. process, , hundreds it, have worked fine on 4 years. now, of sudden c# thinks db password-protected, , have no idea why. paired of code down basic elements, , still doesn't work. if delete more code, i'll have form popping open, , requires no code whatsoever. lol!! can't figure out. if underscore what's going on, i'd appreciate it.
using system;
using system.collections.generic;
using system.componentmodel;
using system.data;
using system.drawing;
using system.linq;
using system.text;
using system.windows.forms;
using system.data.sqlclient;
namespace windowsformsapplication2
{
public partial class form1 : form
{
sqlconnection conn = new sqlconnection("server=excel-pc;database=northwind;trusted_connection=true");
public form1()
{
initializecomponent();
}
private void form1_shown(object sender, eventargs e)
{
try
{
conn.open();
}
catch (sqlexception ex)
{
messagebox.show(ex.message, application.productname, messageboxbuttons.ok, messageboxicon.error);
application.exit();
}
}
}
}
finally, if c# errors made sense @ all, quite simple debug these things. when tells there problem, , different problem completely, it's kind of hard debug stuff.
it's story boy cried wolf. know how ended.
ryan shuell
noam, database connection string ryan using fine. that's not problem lies.
~~bonnie berent dewitt [c# mvp]
geek-goddess-bonnie.blogspot.com
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment