Click here to Skip to main content
15,885,918 members
Home / Discussions / C#
   

C#

 
AnswerRe: If statement with ? and : characters Pin
Pete O'Hanlon16-Jul-09 1:54
mvePete O'Hanlon16-Jul-09 1:54 
GeneralRe: If statement with ? and : characters Pin
soso_online16-Jul-09 2:08
soso_online16-Jul-09 2:08 
QuestionWindows Form Datagridview Pin
Rajeshwar Code- Developer16-Jul-09 0:58
Rajeshwar Code- Developer16-Jul-09 0:58 
AnswerRe: Windows Form Datagridview Pin
Vimalsoft(Pty) Ltd16-Jul-09 1:14
professionalVimalsoft(Pty) Ltd16-Jul-09 1:14 
GeneralRe: Windows Form Datagridview Pin
Rajeshwar Code- Developer16-Jul-09 1:19
Rajeshwar Code- Developer16-Jul-09 1:19 
GeneralRe: Windows Form Datagridview Pin
Vimalsoft(Pty) Ltd16-Jul-09 1:21
professionalVimalsoft(Pty) Ltd16-Jul-09 1:21 
GeneralRe: Windows Form Datagridview Pin
Rajeshwar Code- Developer16-Jul-09 1:36
Rajeshwar Code- Developer16-Jul-09 1:36 
GeneralRe: Windows Form Datagridview Pin
Vimalsoft(Pty) Ltd16-Jul-09 2:02
professionalVimalsoft(Pty) Ltd16-Jul-09 2:02 
Good Day Rajeshwar

I dont use Wizards to do my database.

can you do a Check for me. put your code in a try and check if there are any rows returned

SqlConnection cn = new SqlConnection("server=.;uid=sa;pwd=sa;database=Payroll1");
string ssql = "Select * from EmpDetails";
SqlDataAdapter da = new SqlDataAdapter(ssql, cn);
DataSet ds = new DataSet();

try 
{ 
cn.open();
da.Fill(ds);
BindingSource bindgrd = new BindingSource(); 
bindgrd.DataSource = ds;

if(ds.Tables[0].Rows.count > 0)
{
this.Datagridview1.DataSource = bindgrd; 
}
else
{
lblError.text = "No Rows Returned";
}
catch(SQlException ex)
{
lblError.text = ex.Message;
}
Finaly
{
cn.close();
}


Tell me if you get an Error or there are any Rows Returned. I wrote this here, so the logic is correct , just correct the syntax dont do copy and paste and tell me what it does.

Vuyiswa Maseko,

Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

GeneralRe: Windows Form Datagridview Pin
K030616-Jul-09 1:24
K030616-Jul-09 1:24 
QuestionHorizontal scroll bar on the UserControl Panel not working... Pin
spalanivel16-Jul-09 0:57
spalanivel16-Jul-09 0:57 
QuestionCell click coordinates Pin
Chazzysb16-Jul-09 0:46
Chazzysb16-Jul-09 0:46 
AnswerRe: Cell click coordinates Pin
Chazzysb16-Jul-09 1:04
Chazzysb16-Jul-09 1:04 
QuestionErase a windows event log Pin
Md. Marufuzzaman16-Jul-09 0:15
professionalMd. Marufuzzaman16-Jul-09 0:15 
AnswerRe: Erase a windows event log Pin
Pete O'Hanlon16-Jul-09 0:28
mvePete O'Hanlon16-Jul-09 0:28 
GeneralRe: Erase a windows event log Pin
Luc Pattyn16-Jul-09 1:27
sitebuilderLuc Pattyn16-Jul-09 1:27 
Questionsorting problem in outlook Pin
john563216-Jul-09 0:11
john563216-Jul-09 0:11 
QuestionC# How to HttpWebRequest through chain/cascade of proxy servers Pin
lermi15-Jul-09 23:55
lermi15-Jul-09 23:55 
Questionhow to drag and drop values from one datagrid to another datagrid? Pin
swetha_insoft15-Jul-09 23:41
swetha_insoft15-Jul-09 23:41 
AnswerRe: how to drag and drop values from one datagrid to another datagrid? Pin
swetha_insoft16-Jul-09 0:14
swetha_insoft16-Jul-09 0:14 
Questioncompression of webcam images [modified] Pin
shekhar25839515-Jul-09 23:08
shekhar25839515-Jul-09 23:08 
AnswerRe: compression of webcam images Pin
Manas Bhardwaj15-Jul-09 23:16
professionalManas Bhardwaj15-Jul-09 23:16 
AnswerRe: compression of webcam images Pin
Christian Graus16-Jul-09 1:30
protectorChristian Graus16-Jul-09 1:30 
QuestionServicePointManager.ServerCertificateValidationCallback Pin
himuskanhere15-Jul-09 21:36
himuskanhere15-Jul-09 21:36 
AnswerRe: ServicePointManager.ServerCertificateValidationCallback Pin
jo H20-Jul-09 4:47
jo H20-Jul-09 4:47 
QuestionRecord Not Insert Pin
mjawadkhatri15-Jul-09 21:31
mjawadkhatri15-Jul-09 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.