|
Member 4311057 wrote: I've search a lot but i haven't find
That's because it doesn't exist. If you want to connect applications via the internet then use WebServices.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Did you think about port forwarding? If you skip that on the server, the client can not connect to it.
|
|
|
|
|
I think the port are ok (they're opened i mean,i've open it in the firewall and they seems not to be blocked).
Mark,can you give me a sample were you use webService? (for example a chat)
A chat could be a great example becouse i can change the text message with the data i want to tranfer.
Thanks.
|
|
|
|
|
Ok,i've made a web service that do what i want,the problem is that i can see it only in local network.
How can i made it work (like Apache in PHP) from anywhere in internet ?
Thanks.
|
|
|
|
|
I have a simple C# application that performs some setup tasks and exits, once done, with no user notification. I would like to display a progress dialog showing status. Currently my setup code is in the Run method of the program instance.
I could create two forms. Form A would be not visible and would perform setup tasks. Form A would create Form B that displays progress. Form A could manipulate Form B controls.
This I could have done, but seems unnecessary and not proper. What I was trying to accomplish was including the setup code in the Run function of the program instance. And creating a single progress dialog there. But then I'm missing a message pump for forms? (is that correct wording). Form would not process paint events I'm guessing.
Am I over-thinking this? I would like to accomplish having a thread (maybe original app thread) processing setup tasks, and a separate thread or message pump for form? To accomplish this, I think would help me in understanding more about threading and app processing.
Thanks for your help!
|
|
|
|
|
David Hovey wrote: I could create two forms.
Asynchronous programming might be an answer to your problem.[^]
David Hovey wrote: Am I over-thinking this?
Possibly.
David Hovey wrote: To accomplish this, I think would help me in understanding more about threading and app processing.
That though is true.
My signature "sucks" today
|
|
|
|
|
Use a BackgroundWorker to do the long running tasks and use ReportProgress to update the ProgressBar .
Alternatively, use my ProgressWorker[^] which I made for exactly this purpose.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
David Hovey wrote: Am I over-thinking this?
Yes. You don't need two forms or to use the Run method.
Have one form the displays the progress indicator and, as Davey, suggests use a Background worker to complete the tasks. Start the background operation from the FormLoad event.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
public void InsertPlannedMaterialMasterRequest(int id, string requestDocument, string requestDescription, string requestType, string hodApproval, int companyCode, string hodRemarks, string det_Description, string name, int qty, string code)
{
string query = "INSERT INTO MasterRequest (ID,Req_Document,Req_Description,ReqType,HODApproval,CompanyCode,HODRemarks) VALUES (@ID,@Req_Document,@Req_Description,@ReqType,@HODApproval,@CompanyCode,@HODRemarks)";
SqlConnection con = new SqlConnection(constr);
SqlCommand com = new SqlCommand(query, con);
com.Parameters.Add("@ID", SqlDbType.Int).Value = id;
com.Parameters.Add("@Req_Document", SqlDbType.NVarChar).Value = requestDocument;
com.Parameters.Add("@Req_Description", SqlDbType.NVarChar).Value = requestDescription;
com.Parameters.Add("@ReqType", SqlDbType.NVarChar).Value = requestType;
com.Parameters.Add("@HODApproval", SqlDbType.NVarChar).Value = hodApproval;
com.Parameters.Add("@CompanyCode", SqlDbType.Int).Value = companyCode;
com.Parameters.Add("@HODRemarks", SqlDbType.NVarChar).Value = hodRemarks;
con.Open();
com.ExecuteNonQuery();
con.Close();
string query2 = "INSERT INTO DetailRequest (ID,Req_Document,Description,Approval) VALUES (@ID,@Req_Document,@Description,@Approval)";
SqlConnection con2 = new SqlConnection(constr);
SqlCommand com2 = new SqlCommand(query2, con2);
com2.Parameters.Add("@ID", SqlDbType.Int).Value = id;
com2.Parameters.Add("@Req_Document", SqlDbType.NVarChar).Value = requestDocument;
com2.Parameters.Add("@Description", SqlDbType.NVarChar).Value = det_Description;
com2.Parameters.Add("@Approval", SqlDbType.NVarChar).Value = hodApproval;
con2.Open();
com2.ExecuteNonQuery();
con2.Close();
string query3 = "INSERT INTO ITEMS (ID,Code,Name,Quantity) VALUES (@ID,@Code,@Name,@Quantity)";
SqlConnection con3 = new SqlConnection(constr);
SqlCommand com3 = new SqlCommand(query3, con3);
com3.Parameters.Add("@ID", SqlDbType.Int).Value = id;
com3.Parameters.Add("@Code", SqlDbType.NVarChar).Value = code;
com3.Parameters.Add("@Name", SqlDbType.NVarChar).Value = name;
com3.Parameters.Add("@Quantity", SqlDbType.Int).Value = qty;
con3.Open();
com3.ExecuteNonQuery();
con3.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
MasterRequest_DAL helper = new MasterRequest_DAL();
PlannedMaterialRequest pnd = new PlannedMaterialRequest();
ItemsHandling itm = new ItemsHandling();
string[] labelName = new string[100];
string[] coder = new string[100];
string[] quantity = new string[100];
if (TextBox6.Text != "0")
{
labelName[1] = itm.Code(0).ToString();
labelName[2] = TextBox6.Text;
helper.InsertPlannedMaterialMasterRequest(Convert.ToInt32(TextBox1.Text), TextBox2.Text, TextBox4.Text, DropDownList6.SelectedValue, DropDownList2.SelectedValue, Convert.ToInt32(TextBox11.Text), TextBox12.Text, TextBox13.Text, Label8.Text, Convert.ToInt32(TextBox6.Text), labelName[1]);
}
if (TextBox12.Text != "0")
{
labelName[1] = itm.Code(1).ToString();
labelName[2] = TextBox12.Text;
helper.InsertPlannedMaterialMasterRequest(Convert.ToInt32(TextBox1.Text), TextBox2.Text, TextBox4.Text, DropDownList6.SelectedValue, DropDownList2.SelectedValue, Convert.ToInt32(TextBox11.Text), TextBox12.Text, TextBox13.Text, Label12.Text, Convert.ToInt32(TextBox8.Text), labelName[1]);
}
}
The problem I am facing is that using the above code. The ID goes multiple times in MasterRequest table which should go only once, while the same ID must go to Items table multiple times as per the quantities being entered. I want only the ID to go into MasterRequest table just once not multiple times.
|
|
|
|
|
Hello all!
I'm new to asp.net and i'm trying to bind some XML data to a gridview.
abviously I'm not understanding how to do it properly because that my code doesn't seem to
work...Can anyone could help me please?
this is my xml:
#########################################
<?xml version "1.0" encoding "utf-8"?>
<dictionary>
<item>
<key>
<string> hello world </string>
</key>
<value> <anytype xmlns:q1="http://www.w3.org/2001/XMLSchame" d4p1:type="q1:int"
xmlns:d4p1="http-instance">45</anytype>
</value>
</item>
</dictionary>
and this is my code:
########################################
string path = "D:\\myXmlFile.xml";
DataSet oDs = new DataSet();
ods.ReadXml(path);
GridView1.DataSource = dataSet;
GridView1.DataBind();
thanks
Tom
|
|
|
|
|
Please do not post into multiple forums.
It's time for a new signature.
|
|
|
|
|
I have a code which generated dynamic gridviews based on a column ('c_AnalyticalSystemID"). Now I have a samll problem in passing cell parameter into a textbox which I clicked on a datagridview.
the code is :
private void button1_Click(object sender, EventArgs e)
{
string query = "select t.c_AnalyticalSystemID,t.c_RetentionTime,t.c_IonType , t.c_MSstage, k.c_MSstage, t.c_IonFormula, k.c_IonCharge, t.c_IonMass as 'Mass', t.c_MinArea, t.c_UserID_stamp,c_Time_Stamp,k.c_IonTypeRule from C_Analytical_Type1 t join C_AnalyticalSystems c on t.c_analyticalsystemid = c. c_analyticalsystemid join C_Analytical_Type1_IonTypes k on k.c_iontype = t.c_iontype where t.c_id=" + Convert.ToInt32(textBox1.Text.ToString()) + "";
DataTable dt_cmbo_ = new DataTable();
OdbcDataAdapter cmbo_ = new OdbcDataAdapter("SELECT c_IonCharge,c_IonType,c_IonTypeExplained from C_Analytical_Type1_IonTypes", OdbcCon);
dt_cmbo_.Columns.Clear();
dt_cmbo_.Rows.Clear();
cmbo_.Fill(dt_cmbo_);
OdbcCommand cmd = new OdbcCommand(query, OdbcCon);
OdbcDataReader dr = cmd.ExecuteReader();
DataTable dt1 = new DataTable();
dt1.Load(dr);
int margin = 30;
Point pt = new Point(margin, margin);
panel1.Controls.Clear();
DataTable distinctSystemIDs = dt1.DefaultView.ToTable(true, "c_AnalyticalSystemID");
// DataTable ion = dt.DefaultView.ToTable(true, "c_IonTypeExplained");
for (int i = 0; i <= distinctSystemIDs.Rows.Count -1; i++)
{
int systemID = (int)distinctSystemIDs.Rows[i][0];
DataGridView dgw = new DataGridView();
Label l = new Label();
l.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
l.Location = pt;
l.Text = "System " + systemID.ToString();
pt.Y += l.Height + 2; // margin is for spacing between grids
dgw.Tag = systemID; // store systemID of the DGV if you need it later
dgw.AllowUserToAddRows = false;
dgw.AllowUserToDeleteRows = false;
dgw.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
dgw.Size = new Size(730, 100); // 2 * margin = left + right margin
dgw.Location = pt;
pt.Y += dgw.Height + margin; // margin is for spacing between grids
//this.Controls.Add(dgw);
// dgw.Columns["c_IonTypeRule"].Visible = false;
//dgw.Columns["c_AnalyticalTypeExplained"].Visible = false;
// dgw.Columns["c_ID"].Visible = false;
cmdx.Name = "IonType";
cmdx.DataPropertyName = "c_IonType";
cmdx.HeaderText = "IonType";
cmdx.Width = 80;
cmdx.DataSource = dt_cmbo_;
cmdx.ValueMember = "c_IonType";
cmdx.DisplayMember = "c_IonTypeExplained";
//c_IonTypeRule cmdx.DisplayMember = " c_IonCharge";
panel1.Controls.Add(dgw);
panel1.Controls.Add(l);
dgw.Columns.Add(cmdx);
DataView vw = new DataView(dt1, string.Format("c_AnalyticalSystemID = {0}", systemID), null, DataViewRowState.CurrentRows);
dgw.DataSource = vw;
dgw.Columns["c_AnalyticalSystemID"].ReadOnly = true;
// dgw.Rows[i].Cells["IonCharge"].Value = textBox1.Text;
dgw.Columns[3].Visible = false;
int k = 0;
}
}
private void dgw_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
DataGridViewRow row = new DataGridViewRow();
//DataGridView dgw = new DataGridView();
row = dgw.Rows[e.RowIndex];
// d2 = 1;
// Will put the value of the first column of the selected row into the textbox
textBox60.Text = row.Cells[e.ColumnIndex].Value.ToString();
}
Is it correct what I'm doing to get the value of cell into a textbox when clicked on a paticular datagridview.
The main aim was to edit a record and my head wants to have a single button, so I thought of passing values to textboxs which they want to edit by clicking on that record of that gridview generated automatically. Can you give me an idea how to do this or is there any other way?
Srikanth
|
|
|
|
|
I am new to .Net , I have developed an application using C#.I want check the code quality of my application .Can any one suggest any tool ,which perform code quality check?
|
|
|
|
|
FxCop can do some preliminary (actually more the preliminary - if your rules are set right) analysis.
My signature "sucks" today
modified on Saturday, May 22, 2010 7:24 AM
|
|
|
|
|
There are two tools you can go with (simultanously):
1. FxCop (as mentioned by "Abhinav S").
2. StyleCop
The first one checks if your code conforms to rules Microsoft established for .NET applications design (for example methods, that don't use classes should be declared as static, all fields should be private).
The second one checks your code style (members should be commented, there should be single empty line between members).
Some of rules (like naming rules) are common for both those tools, some can only be found in one of them. Both are great way to learn to write clean and maintainable code.
|
|
|
|
|
StyleCop is new to me
I will download and test
Thanks
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
As it's my first post here I should probably say "Hello"
In WinForms application I'm developing I'd like to have a Panel (let's name it "controlContent"), that should be editable in inherited classes (I want to add controls to it) and second Panel, that will have some buttons common to all controls in this hierarchy. The problem is that when I do it the simplest way - by setting controlContent to be protected - StyleCop says, that field should not be protected, create property instead. Well obviously he's right. But when I create what he want's I don't have access through Visual Studio designer to the Panel. And of course I don't wan't to write controls' layout manually.
Did anyone have similar issue? How can I solve it? (I was searching web, but either I'm asking google wrong questions or answer isn't there).
|
|
|
|
|
StyleCop is right - field members should be private, but this is one of those circumstances where the only sensible way to do what you want is to set the field to protected. Just go with that and ignore the StyleCop rule.
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
Yeah. That's what I'm doing right now. I was just wondering if there's some workaround. Either way thanks for your answer. And I'll still be waiting, maybe someone knows something
|
|
|
|
|
HI
Here i m try to do clear the Browser cookies.
When i m logout my Application
Here i removeall my session but when i m click to back button in my browser its navigating to my application page. But i want to show Login.aspx page could you tell me how to do this?
try and try untill reach success..
|
|
|
|
|
See here for cookies.
My signature "sucks" today
|
|
|
|
|
Hi Experts
Can you tell me how to create the own keyword in .net
like .net in-Built keyword like where,new,from etc..
Dinesh Sharma
|
|
|
|
|
As far as i know you can't.
Why would you want to? There may be a better or existing way to achieve what you want...
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I think you may be a little confused: .NET has no "keywords" - the C# language has keywords, VB has a slightly different set of keywords, C++, F# etc. all have their own keywords.
What are you trying to achieve? If you explain, we may be able to help you to do it.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Actually i am learning LINQ then i see the keyword like from,order by, where etc. in my project which is winForm app. in VS 2005 then i am making DAL(Data Access Layer) for that project so i want to
create such type of keyword in that project..
|
|
|
|
|