|
Please do not attempt to bump your posts. Very rude!!
It is only 5 hours since your previous post. Have a little patience!!!
Whilst your problem is obviously urgent to you, we give our time on a voluntary basis. Therefore your need is greater than ours and if your need is so great I suggest thet you get your Credit Card out and visit rentacoder.com.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
ive got this code, and it works for my old app, but for this one it doesnt work :S
it just repeats the same process with the first item from the listview.
i want it to run through each of them.
and dont worry, i want it to be continuous.
please help :S
while (0 == 0)
{
int iCount = lvAccounts.Items.Count;
string inputURL = textBox1.Text;
inputURL = inputURL.Replace("http://", null);
ListViewItem[] accUserPass = new ListViewItem[iCount];
lvAccounts.Items.CopyTo(accUserPass, 0);
for (int i = 0; i < accUserPass.Length; i++)
{
foreach (ListViewItem item in lvAccounts.Items)
{
{
ListViewItem lvi = new ListViewItem();
ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();
try
{
WebClient dwnload = new WebClient();
byte[] myData = dwnload.DownloadData("http://" + accUserPass[i].Text + ":" + accUserPass[i].SubItems[1].Text + "@" + inputURL);
MessageBox.Show("http://" + accUserPass[i].Text + ":" + accUserPass[i].SubItems[1].Text + "@" + inputURL);
accUserPass[i].SubItems[2].Text = "Downloaded";
int amountdownloaded = Convert.ToInt32(label2.Text);
amountdownloaded = amountdownloaded + 1;
label2.Text = Convert.ToString(amountdownloaded);
}
catch (Exception)
{
accUserPass[i].SubItems[2].Text = "Failed";
}
}
}
}
}
what i want to do is download the same data, but use a different user:pass combination each time.
like
say i have listview like this:
User|Pass
User2|Pass2
i want to download file 'x' with the user pass in front
so with that listview i want to initiate a download of
User:Pass@x
User2:Pass2@x
but with what i have, i just get the User:Pass combination twice
i dont know why
|
|
|
|
|
You never actually use item, you know the items in the listview.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi;
i need to create an invoice (using vs2008) with a certain template i have on paper! will i be able to draw such a template (which is a table) using the word 2007 template applications and print it with some specific data entered at runtime? if it's possible, i need a walkthrough or sample for it and i've never developed this kind of application before so i need a precise document to follow. can anyone help? i really appreciate your answers...
--- Thanks
|
|
|
|
|
Isn't that just a good old fashioned mail merge?
|
|
|
|
|
i don't think so... the application at runtime should open a windows form and the user fills it at runtime and those entries will be inserted in the right cells of the ms word table (the template). as i said earlier, it's an invoice, but a big one! i've searched msdn but didn't find a sample i could use. can you guide me please?
--- Thanks
|
|
|
|
|
That's exactly how mail merge works in word - you create a template document where you specify fields, then word iterates every entry in the data source you give it (be it an excel spreadsheet, a table in a database, or a csv file) and fills in the fields.
Basically you just need to build your table of merge data, and ask word to merge it
|
|
|
|
|
have you searched some thing like word automation...
|
|
|
|
|
Hi
I want to communicate b/w two applications using namedpipes in c#.
when I googled, I found the link http://books.google.co.in/books?id=9fAmRzYaxFgC&printsec=frontcover&dq=oreilly:+C%23+cookbook#v=onepage&q=oreilly%3A%20C%23%20cookbook&f=false which is given in the recipe 16.5, but I doesnot understand how to attach those files to server and client?
|
|
|
|
|
|
I was using vs2005. In this how can I built
|
|
|
|
|
|
i am working with mutiple forms, i want to update the DataGridView of form2 in form3,DAtaGridView gets the table from the data base, i want to update the DataGridView which is in Form2. but cant update it from Form3.DataGridView is not accessable in Form3.
plzzzzzzzzzz help me out.
thanx in advance.
|
|
|
|
|
I am a little confused as too what you want to do, so check if this is correct.
You have two forms:
a) form2 which contains a DataGridView that gets the table from a database.
b) form3 which does some other procesing and wants to supply information to the DataGridView of form2.
c) form3 cannot access the DataGridView of form2.
If this is the case, then it is bad practice to access such members of form2, as it means that form3 becomes reliant on the internal structure of form2. A change to form2 requires a change in form3, which means that form3 cannot be reused easily.
The better way to do this is for form3 to signal an event to form2 ("Update ready" or similar) and provide any necessary data via a queue in form3, or via the event argument.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
modified on Wednesday, August 12, 2009 6:12 AM
|
|
|
|
|
Hi
i created a web service with two method that will be call via sharepoint bdc. my problem is that adf file was successfully imported but it has a warning :
Application definition was successfully imported. 1 warning(s) found. Consider fixing the warnings and updating the application definition.
Warning :
Could not create profile page for Entity News. The error is: Profile page creation for the Entity News skipped. Entity News has no identifiers defined in the SpecificFinder view
Here is my web service :
[WebMethod]
public List<News> GetNews()
{
List<News> list = new List<News>();
using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySqlConnectionString"].ConnectionString))
{
using (MySqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "select id,title,introText,created from jos_content order by created desc,id desc";
if (con.State != System.Data.ConnectionState.Open)
con.Open();
MySqlDataReader dr = cmd.ExecuteReader();
while(dr.Read())
{
list.Add(new News(dr.GetInt32(0), dr.GetString(1), dr.GetString(2), dr.GetString(3)));
}
dr.Close();
if (con.State != System.Data.ConnectionState.Closed)
con.Close();
}
}
return list;
}
[WebMethod]
public List<News> GetNewsByID(int id)
{
List<News> list = new List<News>();
using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySqlConnectionString"].ConnectionString))
{
using (MySqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "select id,title,introText,created from jos_content where id=@id order by created desc,id desc";
cmd.Parameters.Add(new MySqlParameter("@id", id));
if (con.State != System.Data.ConnectionState.Open)
con.Open();
MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
list.Add(new News(dr.GetInt32(0), dr.GetString(1), dr.GetString(2), dr.GetString(3)));
}
dr.Close();
if (con.State != System.Data.ConnectionState.Closed)
con.Close();
}
}
return list;
}
here is my News class :
public class News
{
int _newsID;
string _newsTitle;
string _newsBody;
string _dateCreated;
public string DateCreated
{
get { return _dateCreated; }
set { _dateCreated = value; }
}
public int NewsID
{
get { return _newsID; }
set { _newsID = value; }
}
public string NewsTitle
{
get { return _newsTitle; }
set { _newsTitle = value; }
}
public string NewsBody
{
get { return _newsBody; }
set { _newsBody = value; }
}
public News()
{
}
public News(int id, string title, string body, string dateCreated)
{
this.NewsID = id;
this.NewsTitle = title;
this.NewsBody = body;
this._dateCreated = dateCreated;
}
}
here is my adf file :
<LobSystemInstances>
<LobSystemInstance Name="ServiceInstance">
<Properties>
<Property Name="LobSystemName" Type="System.String">Service</Property>
</Properties>
</LobSystemInstance>
</LobSystemInstances>
<Entities>
<Entity Name="News">
<Properties>
<Property Name="NewsTitle" Type="System.String">NewsTitle</Property>
</Properties>
<Identifiers>
<Identifier Name="NewsID" TypeName="System.Int32"></Identifier>
</Identifiers>
<Methods>
<Method Name="GetNews">
<Parameters>
<Parameter Direction="Return" Name="GetNewsResults">
<TypeDescriptor TypeName="ServiceProxy.News[],Service" IsCollection="true" Name="ArrayOfNews">
<TypeDescriptors>
<TypeDescriptor TypeName="ServiceProxy.News,Service" Name="News">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32" IdentifierName="NewsID" Name="NewsID" />
<TypeDescriptor TypeName="System.String" Name="NewsTitle" />
<TypeDescriptor TypeName="System.String" Name="NewsBody" />
<TypeDescriptor TypeName="System.String" Name="DateCreated" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="FinderGetNewsResultsInstance" Type="Finder" ReturnParameterName="GetNewsResults" ReturnTypeDescriptorName="ArrayOfNews" ReturnTypeDescriptorLevel="0" />
</MethodInstances>
</Method>
<Method Name="GetNewsByID">
<FilterDescriptors>
<FilterDescriptor Type="Comparison" Name="NewsID" />
</FilterDescriptors>
<Parameters>
<Parameter Direction="In" Name="NewsID">
<TypeDescriptor TypeName="System.Int32" Name="NewsID" AssociatedFilter="NewsID" IdentifierName="NewsID" />
</Parameter>
<Parameter Direction="Return" Name="GetNewsByIDResults">
<TypeDescriptor TypeName="ServiceProxy.News[],Service" IsCollection="true" Name="ArrayOfNews">
<TypeDescriptors>
<TypeDescriptor TypeName="ServiceProxy.News,Service" Name="News" IdentifierName="NewsID">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32" Name="NewsID" />
<TypeDescriptor TypeName="System.String" Name="NewsTitle" />
<TypeDescriptor TypeName="System.String" Name="NewsBody" />
<TypeDescriptor TypeName="System.String" Name="DateCreated" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="SpecificFinderGetNewsByIDResultsInstance" Type="SpecificFinder" ReturnParameterName="GetNewsByIDResults" ReturnTypeDescriptorName="ArrayOfNews" ReturnTypeDescriptorLevel="0" />
</MethodInstances>
</Method>
</Methods>
</Entity>
</Entities>
where is my problem and how to solve it ?
thanks
|
|
|
|
|
Hi,
I am making an application integrated with Microsoft Project 2003 in c#. Now ,I want to convert .MPP file in .xml file using C#. I don't how to do this. I need help books or reference guide for integrating with Microsoft Project In C#. if you have any idea .please let me know immediately.
Thanks in advance
Regards,
Rajesh
rajesh
|
|
|
|
|
Hi,
were you able to convert it? since i am having the same problem
Thanks
|
|
|
|
|
Hi !! Have a good day
I have a question, please help me !
I want to split a datatable into many datatables, how to do that by c#.net.
Example : datatable is: DA has 250 rows ==> split into 3 datatable : DA1 (100rows) , DA2(100 rows), DA3(50rows)
If datatable DA has 1000 rows, ==> split into 10 datatables, ( thats mean one datatable have less than 100rows)
Thanks for your help!
|
|
|
|
|
You will have to loop through the rows and copy them into a new datatable. You can also use DataTable.Select method as well instead of looping through all the rows.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
The simplest way would be to write a loop that iterated over the DataTable and allocate rows accordingly. When you do this, you need to clone the table structure, and use ImportRow to copy the row from one table to another. If you attempt to copy the row over directly, you'll get a "row belongs to another table" error. The following method does what you want:
private List<DataTable> CloneTable(DataTable tableToClone, int countLimit)
{
List<DataTable> tables = new List<DataTable>();
int count = 0;
DataTable copyTable = null;
foreach (DataRow dr in tableToClone.Rows)
{
if ((count++ % countLimit) == 0)
{
copyTable = new DataTable();
copyTable = tableToClone.Clone();
tables.Add(copyTable);
}
copyTable.ImportRow(dr);
}
return tables;
}
"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
|
|
|
|
|
Thanks for your method !
But i have little experience in c#. can you explain me what is List<datatable>, how can i define ?
I'm writing in c#.net 2003
|
|
|
|
|
This code working fine..Thanks lot
|
|
|
|
|
I will try to shorten this question. If I have the following class:
public class MyClass
{
public int MyInt {get; set;}
public Button MyBtn {get; set;}
}
Now, let's say I have a for-loop that generates several objects of this class and hooks it up to an event handler like this:
for (int i = 0; i < 5; i++)
{
MyClass myClass = new MyClass();
myClass.MyInt = i;
myClass.MyBtn = new Button();
myClass.MyBtn.Click += (s, e) =>
{
};
}
So, my question is: Is it possible to get the value of 'myClass.MyInt' when the button is clicked? I mean, 'myClass.MyBtn' and 'myClass.MyInt' belongs to the same object. The problem is that I must hook up all buttons to the same event handler.
Thanks for help!
|
|
|
|
|
If you look at the method declaration for your event handler, you'll see a parameter called s of type object - by convention, this is the object that raised the event. So, all you need do is cast s to Button as in:
Button button = s as Button;
if (button != null)
{
}
"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
|
|
|
|
|
Thanks for the reply.
Yes, I know I can get the object that raised that event. But that object belongs to an object 'myClass' which in turn contains 'myClass.MyInt'. Is it possible to get which of the 'myClass.MyBtn' that raised the event. If I can get that I would also be able to read out the value of 'myClass.MyInt'
|
|
|
|