|
thanks , but navaneeth webservices are intended to work platform independently , and xsd format is used to create a common complex type for both server and client, isn't it ?
here the problem is when the namespace.object is created the values should be assigned to another object individually.
the other thing is in the C# client side also i have created an object from xsd generated class.what i want is directly assign the return object to the local object .
any suggestions
|
|
|
|
|
prasadbuddhika wrote: webservices are intended to work platform independently , and xsd format is used to create a common complex type for both server and client, isn't it ?
Yes. When a web service is referenced using VS, Visual studio reads the XSD and creates proxy classes for you. This helps you not to write your own classes.
If you need your own class, then you need to parse the SOAP message and assign values to the fields manually.
|
|
|
|
|
I doing a project to send sms or mms to mobile phone from server using C Sharp. Can anyone help me with it. Thanks
Send the source code to xiaoice_88@hotmail.com
|
|
|
|
|
Most carriers allow email to SMS with the phone number.
some examples I know off handcompany name | email |
---|
T-Mobile: | phonenumber@tmomail.net | Sprint: | phonenumber@messaging.sprintpcs.com | Verizon: | phonenumber@vtext.com |
|
|
|
|
|
pearllyn wrote: Send the source code to xiaoice_88@hotmail.com
Reply to me too LOL
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I am trying to create an application in C# which will extract and save RSS feeds onto the D drive. I am using the following C# code to save the file on the disk
rssReader = new XmlTextReader(FeedAddress.Text);
rssDoc = new XmlDocument();
//Load the XML contents into a XMLDocument
rssDoc.Load(rssReader);
rssDoc.Save("D://text.xml");
Everything works wells and the file is saved in the "utf-8" format if the extension of the link is XML (e.g http://msdn.microsoft.com/rss.xml). The problem comes when I try to save a feed with .rss extension (e.g http://orangecounty.craigslist.org/apa/index.rss), instead of saving the feed in "utf-8" format it saves the feed in "ISO-8859-1" format.
Moreover, when I try to save the feed with .rss extension using the Save As option of the Internet Explorer it saves the feed in "utf-8" format but when I use the C# code to save the same feed it saves it in the "ISO-8859-1" format.
Is there any way to save the feed with .rss extension in "utf-8" format instead of "ISO-8859-1" format?
Thanks
|
|
|
|
|
Hi,
maybe what you need is File.CreateText() and XmlDocument.Save(TextWriter) ?
check the doc!
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,
I am implementing a mechanism that check a user is logged in before showing the aspx pages.
I have tried to implement this in the code behind of the master page of the restricted pages.
In case there is no-one logged in the page must redirect to the appropriate "No-Rights" page.
The problem is that the master page can be used by pages at different folder levels. How to redirect the response to the correct URL of the page? How to specify the URL relative from the web-application root?
Another typical problem here is that when debugging using Visual Studio, the pages are relative to the localhost/PROJECT-NAME/pages. But when deployed the pages are placed directly under HOST/pages.
Can anyone help?
Thanks,
Colin
|
|
|
|
|
First of all this should have been posted in the ASP.NET Boards[^].
From what I recall, you are going to have to use ~ to go to the root of the directory.
i.e.
localhost/Project-Name/Restricted/test.aspx
=
~/Restricted/test.aspx
so even if you were on localhost/Project-Name/Restricted/test.aspx you could reference to the login page with something like this (assuming your login page is in the root of the website), ~/login.aspx
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Good afternoon I am trying to populate a DataGridView, but for some reason when I click the Query button the grid remains blank. I know the query works. My code is as follows:
Form
private void btnQuery_Click(object sender, EventArgs e)
{
PwdSecurity p = new PwdSecurity();
uipc = this.Parent as UIPCMainForm;
const string constrallowedBlockTypes = "allowedBlockTypes";
DAL d = new DAL(uipc.StrUserName, p.base64Decode(uipc.StrPassword));
dgv.DataSource = null;
dgv.Refresh();
bs = new BindingSource();
bs.DataSource = d.AllowedTypes(constrallowedBlockTypes);
dgv.ScrollBars = ScrollBars.Both;
dgv.DataSource = bs;
}
private void btnUpdate_Click(object sender, EventArgs e)
{
dgv.Update();
}
DAL
public DataSet AllowedTypes(string Type)
{
string SQL = String.Empty;
ds = new DataSet();
try
{
SqlCmd = new SqlCommand("spGET_ALLOWED_TYPE", myConnection);
SqlCmd.CommandType = CommandType.StoredProcedure;
SqlCmd.Parameters.Add("@Type", SqlDbType.VarChar, 50);
SqlCmd.Parameters["@Type"].Value = Type;
if (myConnection != null) { myConnection.Close(); }
myConnection.Open();
SqlAdapt = new SqlDataAdapter(SqlCmd);
SqlAdapt.Fill(ds);
}
catch (Exception e)
{
MessageBox.Show("DAL Layer / AllowedTypes method error. \n\r \n\r" +
e.Message.ToString() + " \n\r \n\r" + SQL);
}
finally
{
if (myConnection != null) { myConnection.Close(); }
if (SqlCmd != null) { SqlCmd.Dispose(); }
if (SqlAdapt != null) { SqlAdapt.Dispose(); }
}
return ds;
}
I don't use DataGridView much, but I was wondering if I neglected to create the columns or something. I confirmed the dataset being returned full of data.
Also I am trying update the information on the table if a user changes it on the DataGridView (see btnUpdate event).
Thank you, WHEELS
|
|
|
|
|
Try This[^]
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Good afternoon.
Although I am getting closer, I can't seem to get the DataGridView to populate with the dataset.
private void btnQuery_Click_1(object sender, EventArgs e)
{
PwdSecurity p = new PwdSecurity();
uipc = this.Parent as UIPCMainForm;
const string constrallowedBlockTypes = "allowedBlockTypes";
DAL d = new DAL(uipc.StrUserName, p.base64Decode(uipc.StrPassword));
DataSet ds = new DataSet();
ds = d.AllowedTypes(constrallowedBlockTypes);
dgv.DataSource = null;
dgv.Refresh();
dgv.Columns.Add("ID", "ID");
dgv.Columns.Add("VAL", "VAL");
DataTable dt = new DataTable();
bs = new BindingSource();
bs.DataSource = ds;
foreach (DataGridViewRow dr in dgv.Rows)
{
dgv.Rows.Add(dt);
}
dgv.ScrollBars = ScrollBars.Both;
dgv.DataSource = bs;
}
What am I missing? Thank you, WHEELS
|
|
|
|
|
Given a window handle (IWin32Window), it is possible to get a "screenshot" of what this window currently looks like?
For example, if I have a form that is in some error state, I'd normally call some generic error handler function to display a message and/or log it...this function could be provided with the window handle of the caller...and I'd like this function to take a "screenshot" of the window that made the call, wired up in such a way that anybody could call it in some generic fashion.
I must admit I haven't yet fully thought this through...does this even make sense?
(or, I suppose I could use a Form parameter instead of an IWin32Window, if it would make things easier...)
|
|
|
|
|
I haven't done this just using a window handle. However, if you can access the form object itself you can do something like this:
public void GetFormImage(Form frmIn, String ImagePath)
{
Bitmap bmpFormBackGround = new Bitmap(frmIn.Width, frmIn.Height);
frmIn.DrawToBitmap(bmpFormBackGround, new Rectangle(0, 0, frmIn.Width, frmIn.Height));
bmpFormBackGround.Save(ImagePath);
}
Hope it helps.
|
|
|
|
|
Thanks pelnor...that should go a long way.
|
|
|
|
|
I am relatively new to C# windows programming and have lots to learn. I want to call a function in a child window from the parent window in an MDI application. If I make the function STATIC the parent form can see it, however a control(textbox)in the child function is not recognized, 'MainWindow.FileForm.textBox1' denotes a 'field' where a 'class' was expected'. If I make the function non-static I cannot call it from the parent form. How do I accomplish the call? Thank you..
|
|
|
|
|
You do indeed have lots to learn, and this bit is fundamental.
When you declare a class, it does not exist yet:
public class Car
{
public static int GetWheels()
{
return 4;
}
public int GetFuel()
{
return fuel;
}
}
You can happily count the wheels, because that is common to all cars - they all have the same number of wheels.
...
Console.WriteLine("All cars have {0} wheels", Car.GetWheels());
...
But if you try to get the fuel, the compiler complains that you "need an instance". What it is saying is that a car could be diesel, petrol, or electric. GetFuel() cannot be static, because it is not shared by all cars. You can however refer to instances of cars:
...
Car myCar = new Car("Mitsubishi", "Diesel");
Car yourCar = new Car("Ford", "Petrol");
Car hisCar = new Car("Toyota", "Hybrid");
...
and then it is fine to refer to the specific car and it's fuel type:
Console.WriteLine("Your car is {0}", yourCar.GetFuel());
Console.WriteLine("My car is {0}", myCar.GetFuel());
Console.WriteLine("His car has {0} wheels", hisCar.GetWheels());
Does that make sense?
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
|
|
|
|
|
I like OriginalGriff's analogy!
Just in case it's not clear, and without the car thing...
Somewhere in your parent you are creating an instance of FileForm. Maybe something like this:
FileForm fileForm = new FileForm(); The instance fileForm is what you need to access that instance. If you need to, you can use the Parent's MdiChildren property to iterate over all child windows and find the instance you need.
foreach (Form form in MdiChildren)
{
if (form is FileForm)
{
FileForm fileForm = form as FileForm;
fileForm.YourMethod();
break;
}
} I notice you are trying to access FileForm.textBox1 . Control instances in a form are by default added as private and should stay that way. If you want to do something with a control, add a method or property in the FileForm class and use that to manipulate the control.
public void SetTextBox1(string text)
{
textBox1.Text = text;
}
fileForm.SetTextBox1("Hello World!");
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thank for taking the time to answer. Your suggestions worked! I mistakingly thought that instantiating the FileForm in the parent form would make FileForm labeled "FileWindow" visible.
FileForm FileWindow=new FileForm();
FileWindow.MdiParent=this;
FileWindow.Show();
As I'm an engineer an not a professional programmer I will never learn everything necessary to be competent. Just enough to solve a problem. If there are any books or references that you may know of that focus on applications and you have the time would you please respond.
Regards,
Bill C.
|
|
|
|
|
alias bill wrote: I will never learn everything necessary to be competent
Don't sell yourself short! C# isn't *that* hard. I don't know everything by a long way and still ask questions here myself from time to time, but I consider myself competent.
I don't have any C# books, so I can't recommend any personally. All my knowledge has been gained from studying articles/blogs/MSDN - and with the help of CodeProject, I've learned enough to know when what I am reading is rubbish or is good stuff.
Just keep at it, and with an internet connection you have all you need, though a good book will help if you can find any recommendations.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
i don know what kind of design you have in mind for your application
you can also use usercontrols like pages
create a single form that you fill with the usercontrols designed like page, then bring to front the page you want.
You can do this insead of creating child forms, if you don´t want to open new windows and run all the show in the same window
you have to manage delegates here
nelsonpaixao@yahoo.com.br
trying to help & get help
modified on Thursday, August 6, 2009 8:05 PM
|
|
|
|
|
Hello,
I am trying to use a Session Variable in an update command and the error that I continue to get is:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Server tags cannot contain <%...%>constructs.
It also says that the Datasource is not well formed when I try to enter it in. Could someone help me figure out how to use this?
The session variable I am trying to bring over is a global temp table name. Below is the code.
<asp:SqlDataSource ID="FAR15DataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:Cost_ModelConnectionString %>"
SelectCommand="SELECT Service_Tower_Code, WBS_Code, Ownertype, Compensation_Code, Compensation_Rate, Far_East_FTE, Hawaii_FTE,Mid_Atlantic_FTE, NCR_FTE, North_Midwest_FTE, Northeast_FTE, South_FTE, Southwest_FTE
FROM fn_enterprise_positions(1)"
UpdateCommand="UPDATE <%=Session["TableName"]%> SET Far_East_FTE = @Far_East_FTE, Hawaii_FTE = @Hawaii_FTE, Mid_Atlantic_FTE = @Mid_Atlantic_FTE, NCR_FTE = @NCR_FTE, North_Midwest_FTE = @North_Midwest_FTE, Northeast_FTE = @Northeast_FTE, South_FTE = @South_FTE, Southwest_FTE = @Southwest_FTE
WHERE Service_Tower_Code = @Service_Tower_Code AND WBS_Code = @WBS_Code AND Compensation_Code = @Compensation_Code AND worker_code = @worker_code">
<UpdateParameters>
<asp:FormParameter Name="Service_Tower_Code" FormField="Service_Tower_Code" />
<asp:FormParameter Name="WBS_Code" FormField="WBS_Code" />
<asp:FormParameter Name="Compensation_Code" FormField="Compensation_Code" />
<asp:FormParameter Name="worker_code" FormField="worker_code" />
<asp:FormParameter Name="Compensation_Rate" FormField="Compensation_Rate" />
<asp:FormParameter Name="Far_East_FTE" FormField="Far_East_FTE" />
<asp:FormParameter Name="Hawaii_FTE" FormField="Hawaii_FTE" />
<asp:FormParameter Name="Mid_Atlantic_FTE" FormField="Mid_Atlantic_FTE" />
<asp:FormParameter Name="NCR_FTE" FormField="NCR_FTE" />
<asp:FormParameter Name="North_Midwest_FTE" FormField="North_Midwest_FTE" />
<asp:FormParameter Name="Northeast_FTE" FormField="Northeast_FTE" />
<asp:FormParameter Name="South_FTE" FormField="South_FTE" />
<asp:FormParameter Name="Southwest_FTE" FormField="Southwest_FTE" />
</UpdateParameters>
</asp:SqlDataSource>
I did originally have a <asp:SessionParameter Name="TableName" /> inside the update parameters but that didnt seem to do anything. Thanks for your help!
John Michael
|
|
|
|
|
This is C# Forum. Please post it on ASP.NET Forum
|
|
|
|
|
Hi,
I have been trying to populate a table in word from C#, originally i was using this code which i found on an article on this site and just adapted:
public void CreateFileColumn(ArrayList array, Array Numbe)<br />
{<br />
object missing = System.Reflection.Missing.Value;<br />
object fileName = "normal.dot";<br />
object newTemplate = false;<br />
object docType = 0;<br />
object isVisible = true;<br />
Object oUnit = Word.WdUnits.wdCell;<br />
<br />
<br />
wordApp = new Word.ApplicationClass();<br />
wordDoc = wordApp.Documents.Add(ref fileName, ref newTemplate, ref docType, ref isVisible);<br />
wordApp.Visible = true;<br />
wordDoc.Activate();<br />
<br />
wordApp.Selection.Tables.Add(wordApp.Selection.Range, 1, 8, ref missing, ref missing);<br />
<br />
wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;<br />
wordApp.Selection.Font.Bold = (int)Word.WdConstants.wdToggle;<br />
<br />
<br />
foreach (string part in Numbe)<br />
{<br />
wordApp.Selection.InlineShapes.AddPicture(@"C:\Users\Jon\Documents\Nick\Chin Font Files\" + part + ".jpg", ref missing, ref missing, ref missing);<br />
wordApp.Selection.MoveRight(ref oUnit, ref missing, ref missing);<br />
}<br />
<br />
<br />
<br />
<br />
}
all this does is take an image from the folder listed and place them in a cell in the table, and keeps doing this until the arraylist is empty. However, it has got to the point now where i need to be more precise then just move right, i need to select which table i am in and what cell i am placing the image in. I know there is ways using cell[] and table[], but i don't know how to implement this in this piece of code.
Any help would be greatly appreciated
|
|
|
|
|
try using this
Word.Range rngC
rngC = YourTableName.Cell(i, j).Range
rngC.InlineShapes.AddPicture(with all the params you need)
i = column
j = row;
|
|
|
|
|