|
Thanks a lot, now its working
Back off i am coding
|
|
|
|
|
Hi Every one,
now i m using window forms using C# , so my doubt is how can i bind datagridview to dataset . actually i finishes wrote code , but when i trace it ..data getting into datasource but its not displaying into datagridview ..let me Know is there any i can change into datagridview property . Please if u know scarp me.
Thanks
Raj
Some Thing need 2 do NEW
|
|
|
|
|
We cant know why? because we don't see the code.
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/
|
|
|
|
|
Thanks for reply bro..
I need the answers bro..i thnik its not answer..
Some Thing need 2 do NEW
|
|
|
|
|
We cannot Help until we see the code where you bind the Grid
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/
|
|
|
|
|
Ok bro ..
this is my code once through it let me know where i did mistake.
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();
da.Fill(ds);
BindingSource bindgrd = new BindingSource();
bindgrd.DataSource = ds;
this.Datagridview1.DataSource = bindgrd;
Some Thing need 2 do NEW
|
|
|
|
|
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/
|
|
|
|
|
Try this sample code
SqlCommand cmd = new SqlCommand();
cmd.Connection = sqlConnection();
cmd.CommandText ="your query";
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
datagridview1.DataSource = ds;
Regards,
Karthik K...
|
|
|
|
|
Hi,
I have created a Windows Form as "usercontrol" using vs.net 2003 with c#. In that Form I placed a Panel and below a horizontal scrollbar control. While I am trying to view the extreme right content of the Panel with the help of horizontal scroll bar the panel content is not viewable.(ie Panel content is not moving left- right)
And also I set "this.pnlWorkArea1.AutoScroll = true;" and its showing scrollbar but its not moving beyond the current viewable area.
Example: From the panel i am plotting graph with numbers 1 to 40 only its viewable up to 25.
Please advice me.
Thanks,
Palanivel
|
|
|
|
|
Hi,
I have a grid that displays multiple images (the grid can scroll horizontally and vertically)
At runtime I draw rectangles on each of the images which i intend to act as buttons.
I want to perform functions when when the user clicks on these drawn images.
How can I get the coordinates of the click event relative to the location of the cell? ie assuming the top left of each cell is 0,0
Thanks,
Chas
|
|
|
|
|
Found the answer:
it was the CellMouseClick event e.X and e.Y...
|
|
|
|
|
Hi,
How to erase a windows event log file programmatically.
Any idea..
Thanks
Md. Marufuzzaman
|
|
|
|
|
Assuming you have the relevant permisions, you can use EventLog.Delete to delete a particular log. Here's how I figured it out (who knows, this thought process may help you):
First of all, I thought to myself - this is an operation on the EventLog . Now, I know that there is an EventLog class, but if I hadn't known this the name would have seemed a logical place to start.
Then I thought - perhaps it has a DeleteLog entry.
I typed EventLog.DeleteLog into Google, and it suggested that it should actually be EventLog.Delete .
From there, I hopped over to the docs just to check that it was the item I thought it was - job done.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
You should buy a lottery ticket today
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
Whenever I tried to sort the mail item, it does not effect.
Microsoft.Office.Interop.Outlook.MAPIFolder mItem = TraverseTee(outlook.Session.Folders, "myfolder");
if(mItem!=null)
{
mItem.Items.Sort("Received", false);
int i=0;
foreach(Microsoft.Office.Interop.Outlook.MailItem item in mItem.Items)
{
listBox1.Items.Insert(i,item.Subject);
i++;
}
}
|
|
|
|
|
Hello,
I can't seem to find a solution that would allow me to connect through a chain of proxies using HttpWebRequest object. HttpWebRequest class does have a Proxy property but it only allows you to assign a single Proxy hop and this works as expected. What I need though is to create a connection throgh 3 proxy servers and I would like to know if this is possible with HttpWebRequest. If not I would like to know if there is any other way of doing this in .NET 3.5, maybe an open source library, or an example, anything that would help. If even this does not exist I would like to know if there are any open source 3rd party tools that would allow me to do this.
Thank you for your answers in advance
Yours sincerely,
Andrea
|
|
|
|
|
My application having two datagrids-->datagrid1 and datagrid2
datagrid1 is having ID,FileName,Comments columns
datagrid2 is having FileName column.
i wantt to drag and drop value from datagrid1 to datagrid2.
can anyone help me
|
|
|
|
|
private void datagrid2_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(DataGridViewRow)))
{
e.Effect = DragDropEffects.Copy;
}
}
private void datagrid2_DragDrop(object sender, DragEventArgs e)
{
DataGridViewRow row = e.Data.GetData(typeof(DataGridViewRow)) as DataGridViewRow;
if (row != null)
{
DataGridViewRow newrow = row.Clone() as DataGridViewRow;
//for (int i = 0; i < newrow.Cells.Count; i++)
//{
newrow.Cells[0].Value = row.Cells[1].Value;
//}
//this.datagrid2.Rows.Add(newrow);
datagrid2.Rows.Add(newrow);
}
}
private void datagrid1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.gvDocuments.datagrid1(this.gvDocuments.CurrentRow,
DragDropEffects.All);
}
}
|
|
|
|
|
i having a smartcard of 4kb but i have only 800 bytes
hw can i compress webcam image into less then 1 kb
nd store it to smart card
becoze this card having some fields like name address etc. nd the fingure prints
but we need to store a image to webcam nd store it in smart card anyone can help me?????????
i must hav to store it i have only 800 byte free in smart card
modified on Thursday, July 16, 2009 5:25 AM
|
|
|
|
|
shekhar258395 wrote: hw can i compress webcam image into less then 1 kb
Dont you think, 1 KB for a any image file is too ambitious.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You've asked this before. The answer is, make the image REALLY small, and store it in a compressed format. greyscale jpeg is probably a good choice.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Dear Friends,
I stuck at a point, to download a file from HTTPS site.
I have a secured web site https/www.mySite.com/.
I havent any idea which Certificate that server is using.
I just want to down load a file from that site.
For that I have written the code:
private static bool ValidateRemoteCertificate(<br />
object sender,<br />
X509Certificate certificate,<br />
X509Chain chain,<br />
SslPolicyErrors policyErrors<br />
)<br />
{<br />
<br />
if (policyErrors == SslPolicyErrors.None)<br />
return true;<br />
else<br />
return false;<br />
<br />
<br />
));<br />
<br />
but it always shows the error "System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch"
and if i forcefully return true it works fine...
what is proper solution??????
thnaks in advance
|
|
|
|
|
If you are happy to disable the checking of the certificate (not recommended) then use something like
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(
delegate
{
return true;
});
If you are using a WebClient for instance, it should go just before you do the call that will connect (i.e. client.UploadFile(), client.UploadValues(), etc)
|
|
|
|
|
Hi
please check my coding and guide me why record not insert
my coding is
OdbcConnection cn;
OdbcCommand cmd;
OdbcDataReader odr;
string MyString;
MyString = "Select empid , sysdte from timemgmt";
if (radioin.Checked == true)
{
cn = new OdbcConnection("Driver={Microsoft ODBC for Oracle};Server=orcl8i;UID=itehad;PWD=creative;");
cmd = new OdbcCommand(MyString, cn);
cn.Open();
cmd.CommandText = "Select empid , sysdte from timemgmt where empid = '"+textBox1.Text+"' and sysdte ='"+label19.Text+"'";
//MessageBox.Show("Connected");
//cmd.CommandText = "select empid,sysdteinsert into timemgmt values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";//,'" + label18.Text + "','" + label18.Text + "')";
//MessageBox.Show(cmd.CommandText);
//cmd.ExecuteNonQuery();
odr = cmd.ExecuteReader();
while (odr.Read())
{
if (textBox1.Text == (odr["empid"].ToString()) && label19.Text == (odr["sysdte"]).ToString())
{
MessageBox.Show("You Already IN this ID Today");
}
else
{
cmd.CommandText = "insert into timemgmt values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";
}
}
cn.Close();
|
|
|
|
|
It would be helpful if you posted the error generated!
This assumes there are only 4 field in the table.
cmd.CommandText = "insert into timemgmt values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";
If there are more you need
cmd.CommandText = "insert into timemgmt (field1, field2, field3, field4) values('" + textBox1.Text + "','" + label19.Text + "','" + label18.Text + "','" + label18.Text + "')";
Never underestimate the power of human stupidity
RAH
|
|
|
|