|
How about CheckChanged (like in CheckBox) ?
|
|
|
|
|
yepper that is what I found also.
|
|
|
|
|
im sorry, but i really need a help at my graduation project.......
How can i program the IP layer using socket programming on visuial C# at windows invironment??????
|
|
|
|
|
Do you want to program the IP layer, or do you want to send something over a socket[^]?
I are Troll
|
|
|
|
|
If you want to develop application using sockets in c# check out this[^] article.
Also Refer to this[^] if you want to understand what is socket.
Also Refer to System.net.sockets[^] class help.
|
|
|
|
|
Hi.
I am pretty new on C#, but since I have VB.NET background, I am not that lost.
I am looking to do two things.
1. I have records showing in text boxes that I bind from SQL Server 2005. I need to navigate through the records, showing the next record, till the last record. I need to use the "End of record" function.
2. I want to insert into the last column of my SQL Server 2005 database. But I need to find the last record on the table and increment the UserID(primary key) by one, and use the new value as the new UserID(primary key) on the new column.
Can you please help me with this.....
Thank you in advance guys.
|
|
|
|
|
Erhm... I see you're still talking about 'records'. This is a term used in VB. We got rid of records since VB.NET. Now we're talking about rows.
You cannot loop through a recordset and 'ask' the recordset if the EOF is reached. You have a 'table' which is your 'recordset' containing a collection of rows (tbl.Rows).
For example :
SELECT * FROM Users
The SQL statement loads all 'records' from the database table 'Users'.
Using C# :
using (DataTable tblUsers = new DataTable("Users"))
{
using (SqlConnection myConn = new SqlConnection(ConnectionString))
{
using (SqlDatAdapter adpUsers = new SqlDataAdapter("SELECT * FROM Users", myConn))
{
myConn.Open();
adpUsers.Fill(tblUsers);
myConn.Close();
}
}
foreach (DataRow drUserInformation in tblUsers.Rows)
{
}
}
|
|
|
|
|
Owkay, I have a feeling you are not understanding what I mean.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Connections
{
public partial class subForm : Form
{
public subForm()
{
InitializeComponent();
}
private void subForm_Load(object sender, EventArgs e)
{
buttonUpdate.Text = "Update";
string connectionString = @"Data Source=DBJNBWS0015\SQLEXPRESS;Initial Catalog=CarDealership;Integrated Security=True";
string sqlSel = @"Select * From Klient";
SqlConnection conndb = new SqlConnection(connectionString); //make a OleDbConnection object
DataSet ds = new DataSet(); //make a DataSet object
try
{
SqlDataAdapter myAdapter = new SqlDataAdapter(sqlSel, conndb); //Using the OleDbDataAdapter execute the query
myAdapter.Fill(ds, "Klient"); //Fill the DataSet with the Table 'Customers'
//dataGridView1.DataSource = ds.Tables["Klient"];
textBoxID.DataBindings.Add("Text", ds, "Klient.UserID");
textboxTitle.DataBindings.Add("Text", ds, "Klient.Title");
textBoxName.DataBindings.Add("Text", ds, "Klient.FirstName");
textBoxSurname.DataBindings.Add("Text", ds, "Klient.LastName");
textBoxLocation.DataBindings.Add("Text", ds, "Klient.City");
myAdapter.Dispose();
}
catch (Exception a)
{
MessageBox.Show("Error in connecting! " + e.ToString(), "Error");
}
finally
{
conndb.Close(); //Close the OleDbConnection
conndb.Dispose();
}
}
This simple code works. From this text boxes, I need to view the next row of data, and I have a button that inserts into a new row. before inserting, I need to make sure I am at the last row...In other words, I need to insert into a new row immediately after the last row.
|
|
|
|
|
Thank you guys...I have managed to read from the database.
Now the second trick is writing back to the database reading from the textboxes
|
|
|
|
|
i was complete my project the out put is send into Crystal Reports.but i need to send into PDF Fromate.how to do this program
adv thanks
lavan
|
|
|
|
|
You have to buy a PDF library, or find a free one that does what you want. I'm not sure how you'd integrate it with crystal reports.
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.
|
|
|
|
|
If I'm not mistaken pdf export can be done using the Crystal reports object model. You don't need additional software for that.
|
|
|
|
|
Depending on your version of crystal reports, crystal reports has an export to PDF method.
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim ExportPath As String = IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData, attachmentName & ".pdf")
' Set the path for the exported report
crDiskFileDestinationOptions = New DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = ExportPath
' Set the options to export the report to PDF format
crExportOptions = rpt.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
' Export the report
rpt.Export()
with rpt being your crystal report.
(code is in vb.net but I'm sure you can convert that)
|
|
|
|
|
I've seen PDFSharp[^] recommended several times although I've never used it myself. If you don't mind creating a file first then you can use one of the numerous PDF print drivers out there - I use Bullzip[^].
|
|
|
|
|
public class Comparer<T>
{
public static bool AreEqual(T o1, T o2)
{
return (o1 == o2);
}
}
//problem is with O1 == o2
//Help me?
//URGENT
|
|
|
|
|
because you've not specified that T needs to be an object that has an operator ==, I'd say. It's hard to tell for sure, given that you've not told us the error. I believe you can use .Equals, which is on the object class, but not ==. Again, if I'm wrong it's because you've given me nothing to go on.
http://msdn.microsoft.com/en-us/library/d5x73970.aspx[^] is an article on constraints in generics.
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.
|
|
|
|
|
i think ...what u said is correct....
..the error i am getting is "operator == can not be applied to operands of type T and T"
thanks for ur reply .....
|
|
|
|
|
The reason is not everything implements the == operator. All classes (reference types) do, but not all structs (value type) do. If you know that T is always going to be a class then you can use
public class Comparer<T> where T: class
{
} and your code will work.
All objects implement Equals(object obj) so you can use o1.Equals(o2) , but it may not give the result you expect depending on the struct's/class' implementation of this method.
|
|
|
|
|
Hi,
I am able create emails with custom headers using c#..Is it possible to make these headers persistent on reply or forward action etc..can anyone help me with this..
|
|
|
|
|
Why are a lot of people suddenly asking questions that seem to assume that their C# code can somehow control the behaviour of other mail programs such as Outlook and gmail ?
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.
|
|
|
|
|
Same reason as people ask how they print using ASP.NET - fundamental lack of understanding.
We were all beginners once.... I keep telling myself.
|
|
|
|
|
To quote Arthur, "any sufficiently advanced technology is indistinguishable from magic".
You can do all kind of magic things with C#, and you can get tha codez here
I are Troll
|
|
|
|
|
Your question makes no sense. go back a step and try to explain what you're trying to achive (not how you think you might implement it)
|
|
|
|
|
Hi,
What i am trying to say is .. I have created an e mail message with custom headers with smtp.emailmessage . When this email is received , it would get forwarded or replied to. But i believe on any such action(forward or reply to) all custom headers get removed and new headers are added by the redirecting server. I have certain information in the custom headers that i have created which i would like to retain when i receive the forwarded message. Is there any work around for this. I am willing to make changes in my implementation to any extent as long as it meets my primary objective to get some information across..
Thanks..
|
|
|
|
|
Hi there,
I have a situtation, I am on my way to build an alarm application which will run in the background and will intimate the user for an event which he had set before. Exactly what a scheduler or alarm clock does.
I will explain the design in short here. I maintain the tasks set by the user in a list of "Task" class. With every tick of the timer I initiate a background thread that will poll the task list to check if there are any tasks for the present time stamp. If yes it will raise an event which does the work of intimating the user by playing a music and displaying a form.
The, back ground thread is needed so that the main thread does not have to wait for the scanning of the list.
So far so good. The application is working well. But I know at heart that the List is not a good thing to use in this case as the application will terribly fail if the list is too long. may be the user will be intimated 2-3 mins after the time he may had set his alarm to.
I request for suggestions about which data structure to use here, if not list. I know there are some very fast list like structures (Like something used by the word suggesting thread of the MS Word, as it can pick up words from huge ocean of words.). However I dont know what they are and how to use them. If you suggest a design change, I whole heartedly shall agree. I know it is not a very good design.
Sincerely looking for your suggestions.
Best Regards,
Sid
|
|
|
|