Click here to Skip to main content
15,300,806 members

Comments by Arjunwalmiki (Top 90 by date)

Arjunwalmiki 10-Jun-14 7:12am View
   
in this line i am got error

foreach (DataRow dr in ds.Tables["TemplateMaster"].Rows)
{
Arjunwalmiki 6-May-14 1:58am View
   
for (var i = 0; i<tbl_A.length; i++)
{
var arrlen = tbl_A.length.checkintime;
for (var j = 0; j
Arjunwalmiki 6-May-14 1:56am View
   
Deleted
for (var i = 0; i<tbl_A.length; i++)
{
var arrlen = tbl_A.length.checkintime;
for (var j = 0; j
Arjunwalmiki 6-May-14 1:38am View
   
i want lowest time as per eid pls help
Arjunwalmiki 6-May-14 1:29am View
   
Paulo Augusto Künzel thank you for reply But i know codeproject vast library of articles but i am new so i don't know how to compare object in same arraylist if you know so pls help me i need lowest checkintime as per ID if yyou know pls help me
Arjunwalmiki 3-May-14 6:45am View
   
Thank you for reply

Can
for(i=0;i<tbl_A.length;i++)
{
for(j=i+1;j < tbl_A.length; j++)
{
array1[i] ? array[j];
alert("Arjun" +array1[i] + array[j]);
}}
this code work i want lowest check in time or high checkouttime from array list and i am new in this field pls help me
Arjunwalmiki 11-Apr-14 5:03am View
   
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" + db + ".@TABLE_NAME' at line 1


I am face this eroor
Arjunwalmiki 11-Apr-14 4:49am View
   
i was try but query not excited
Arjunwalmiki 11-Apr-14 4:06am View
   
using (MySqlCommand cmd = new MySqlCommand("SHOW COLUMNS FROM " + db + ".'@TABLE_NAME'", con))
{
//cmd.Parameters.Add("@TABLE_SCHEMA", MySqlDbType.VarChar).Value = db.ToString();
cmd.Parameters.Add("@TABLE_NAME", MySqlDbType.VarChar).Value = lbOtherTable.SelectedValue;

new MySqlDataAdapter(cmd).Fill(dt);
}
pls can you let me know why my code is not working
Arjunwalmiki 11-Apr-14 3:36am View
   
i have done some change my query is ("SHOW COLUMNS FROM "+ db +".TABLE_NAME = '@TABLE_NAME'",con)
can it is right?
Arjunwalmiki 5-Mar-14 0:30am View
   
pls follow this link might be help you

http://kathirvelmariappan.blogspot.in/2009/03/mysql-error-1067-process-terminated.html
Arjunwalmiki 5-Mar-14 0:27am View
   
if you received Error "The process terminated unexpectedly" it is simple thing still your mysql server service not started if you services start than problem solved.
Arjunwalmiki 4-Mar-14 2:27am View
   
Deleted
string st = txtOtherConStr.Text.Trim();
string []st1=st.Split(;);
st=st1[3];

is this right ?
Arjunwalmiki 4-Mar-14 2:26am View
   
Sorry i don't know this
Arjunwalmiki 4-Mar-14 2:25am View
   
ErBhati,

string st = txtOtherConStr.Text.Trim();
string []st1=st.Split(;);
st=st1[3];

is this right?
Arjunwalmiki 19-Feb-14 5:46am View
   
The multi-part identifier "System.Data.DataRow" could not be bound this is error
Arjunwalmiki 15-Feb-14 2:21am View
   
int ScriptId = 0;

string sql = "Select Max(ScriptId) as ScriptId from tbl_Script";
SqlCommand cmd = new SqlCommand(sql, connection);
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();

if (reader[0] == System.DBNull.Value)
{

ScriptId = 1;
}
else
{
int i = Convert.ToInt32(reader["ScriptId"].ToString());
ScriptId = (i + 1);
}

}

thank you abhinav my problem was solve i have done change as you told me my correct code is look like this but dude if i am recived null value from table i want to set one

if (reader["ScriptId"] == System.DBNull.Value)
{

ScriptId = 1;// is this right or ?
}
Arjunwalmiki 14-Feb-14 3:25am View
   
okey
int myvalue = 0;
string mycommand = "INSERT INTO Table2(FieldName) VALUES(" + myvalue.ToString() + ")";
this code is working

but can you know if i am use store procedure than how can insert + myvalue.ToString() + in to 5 table
Arjunwalmiki 14-Feb-14 2:21am View
   
i am change
var ScriptId = 0;
know received error is in code line if (reader["ScriptId"] == System.DBNull.Value)
indexoutofrangeexception was unhandled
Arjunwalmiki 14-Feb-14 2:18am View
   
Deleted
i am change
var ScriptId = 0;
know received error var ScriptId = 0;

indexoutofrangeexception was unhandled
Arjunwalmiki 14-Feb-14 1:56am View
   
for e.g i am save one id in variable and save variable data want to save in multiple table so how can it is possible if you have some code pls give to me
Arjunwalmiki 14-Feb-14 1:37am View
   
Yes Vijay you r right
Anyway, in your code, you are assigning "null" as string to ScriptId variable. Which will make the variable of type string. So, you can not increment string value. In the code your doing same in if and else condition.

i want to do same thing actully in my table value is null if null than var ScriptId =1;
else Iif i am get one value from table) ScriptId ++;
Arjunwalmiki 13-Feb-14 4:38am View
   
your query is working fine EXEC sp_tables @table_type = "'TABLE'" but how can set it in this query string str = "USE " + strintTable + " SELECT * FROM sys.Tables";
Arjunwalmiki 13-Feb-14 4:37am View
   
SELECT * FROM information_schema.tables thsi query is not working
Arjunwalmiki 13-Feb-14 4:36am View
   
SELECT * FROM datamigrationtest.sys.Tables; this query is not working
Arjunwalmiki 13-Feb-14 4:34am View
   
i want all table name from datamigrationtest (database)? just like
string str = "USE " + strintTable + " SELECT * FROM sys.Tables";
Arjunwalmiki 11-Feb-14 6:07am View
   
i want to save 2 lable.text value in the Atable and also want to save Btable id in the Atable.
Arjunwalmiki 7-Feb-14 3:47am View
   
hi
this is my code

protected void btnDatabaseMigration_Click(object sender, EventArgs e)
{
string str = string.Empty;
DataSet ds1 = new DataSet();
DataView dv;

foreach (ListItem li in TableCheckBoxList.Items)
{
if (li.Selected)
{
MySqlConnection myconn3;
string abc = "";
abc = "Data Source=localhost;Initial Catalog=" + lblMySqlDB.Text + ";user id=root;password=root";
myconn3 = new MySqlConnection(abc);
myconn3.Open();
str = li.ToString();
string query = "Select " + str + " from " + lblMySqlDB.Text + "." + Label5.Text + "";
MySqlDataAdapter mydata = new MySqlDataAdapter(query, myconn3);
DataTable dTable = new DataTable();
mydata.Fill(ds1, str);
dv=ds1.Tables[0].DefaultView;
DataTable table = ds1.Tables[0];
dv.Sort = "" + str + " DESC";
myconn3.Close();

}


// int a = 0;
foreach (DataTable dt in ds1.Tables)
{

}
if (ds1.Tables.Count > 0)
{
string strForSqlServer = string.Empty;
DataSet dsForSqlServer = new DataSet();
foreach (ListItem listOFSQL in CheckBoxIntellectTableData.Items)
{
if (listOFSQL.Selected)
{
SqlConnection sqlconForMigration;
// string abc = "";
// abc = "Data Source=localhost;Initial Catalog=" + lblSqlDatabase.Text + ";user id=root;password=root";
foreach (DataRow dr in ds1.Tables[0].Rows)
{
//for (int i = 0; i < dr.Table.Columns.Count; i++)
//{
sqlconForMigration = new SqlConnection(strIn);
sqlconForMigration.Open();
strForSqlServer = listOFSQL.ToString();
string query = "insert into " + lblSqlTableName.Text + "(" + strForSqlServer + ") values ('" + dr[0].ToString() + "')";
SqlCommand cmd = new SqlCommand(query, sqlconForMigration);
cmd.ExecuteNonQuery();
sqlconForMigration.Close();
//}
}

}
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Added In MSSQL Table')", true);
}

// a++;

}


}

in this code i am select data from mysql server and insert in to mssql table but i want to save 10 to 20 script just like this and later want to execute 10 to 20 script daily or as per requirement
Arjunwalmiki 3-Feb-14 5:09am View
   
System.Data.DataRowView

and in this code

int sel = checkedListIntellect.SelectedIndex;
if ( sel >= 0 && checkedListIntellect.GetItemCheckState(sel) == CheckState.Checked)
{
db = checkedListIntellect.SelectedItem.ToString();
}
i am not get selected value pls help on place of get selected value System.Data.DataRowView
Arjunwalmiki 3-Feb-14 5:04am View
   
string db = "";
foreach (var item in this.checkedListIntellect.CheckedItems)
{
if (checkedListIntellect.SelectedIndex < 0)
{

db = checkedListIntellect.SelectedItem.ToString();


}
}

if (checkedListIntellect.SelectedIndex < 0)
This condition is false
so this line is Null(db = checkedListIntellect.SelectedItem.ToString();)
Arjunwalmiki 30-Jan-14 23:59pm View
   
dear prasad

i am already host my project in IIS 7.5 but due to Windows Authentication data not retrieve from server so i need solution of it
Arjunwalmiki 24-Jan-14 4:32am View
   
Dear Karthik i am not mix any thing i am using multiple checkboList in our project 1) Checkboxlist bind from MYServer(in ist list iam able to seen all batabase list in checkboxlist)

if use select 2 database from the same so new 2 checkboxlist bind with each batabase table.

know use check one table from checkboxlist and query fire select * from databaseName.TableName;

so my question how can handle it you must create globaleVariable and must be save database in side it and second table name also want to save in globalevariable than you able to fire select * from globlevaribaledatabaseName.globlevaribaleTableName; that is my logic if i am wron correct me and pls help me i am stuck
Arjunwalmiki 24-Jan-14 3:50am View
   
Karthik that way i need to mydata.Fill(ds, str); store ds in globale variable than i can use it any where in the same page
Arjunwalmiki 24-Jan-14 2:09am View
   
foreach (ListItem li in CheckBoxList2.Items) { if (li.Selected) in this foreach i am found table name so i want to use connection string as per table selected for e.g table came arjun and batabase in string Con2 so how can get it as per table than my query fire select * from DbName.Table name
Arjunwalmiki 24-Jan-14 0:51am View
   
yes salman thank you i am follow the karthik
Arjunwalmiki 24-Jan-14 0:48am View
   
Hi Karthik gm

This is my code :-

protected void Button1_Click(object sender, EventArgs e)
{
string str = string.Empty;
DataSet ds1 = new DataSet();
string con1 = GlobalClass.ConnectionString["Con1"];
string con2 = GlobalClass.ConnectionString["Con2"];
string con3 = GlobalClass.ConnectionString["Con3"];
string con4 = GlobalClass.ConnectionString["Con4"];
foreach (ListItem li in CheckBoxList2.Items)
{
if (li.Selected)
{
MySqlConnection myconn3 = new MySqlConnection(con1);

myconn3.Open();
str = li.ToString();
string query = "show COLUMNS from " + str + "";
MySqlDataAdapter mydata = new MySqlDataAdapter(query, myconn3);
mydata.Fill(ds1,str);
myconn3.Close();
}
int a = 0;
foreach (DataTable dt in ds1.Tables)
{
if (a == 0)
{
TableCheckBoxList.DataSource = ds1.Tables[0];
TableCheckBoxList.DataTextField = "Field" ;
TableCheckBoxList.DataValueField = "Field";
TableCheckBoxList.DataBind();
}
if (a == 1)
{

CheckFromTable.DataSource = ds1.Tables[1];
CheckFromTable.DataTextField = "Field";
CheckFromTable.DataValueField = "Field";
CheckFromTable.DataBind();
}
a++;
}

}
}
my code only get one database table i want both database table in new checkboxlist
Arjunwalmiki 23-Jan-14 7:20am View
   
public class GlobalClass
{ public static string ConnectionString { get
{ return "Data Source=localhost;Initial Catalog=arjun;user id=root;password=root";
"Data Source=localhost;Initial Catalog=hr;user id=root;password=root";
"Data Source=localhost;Initial Catalog=bsales;user id=root;password=root";
} }
}

Karthik it is working fine but if i am using 5 database how can handle it
Arjunwalmiki 23-Jan-14 7:06am View
   
Salman can you seen my code how can i do batter way please let me know
Arjunwalmiki 23-Jan-14 7:04am View
   
Deleted
Karthik can you seen my code how can i do batter way please let me know
Arjunwalmiki 22-Jan-14 3:47am View
   
Select * from Database.TableName; how can i get both database and table name using c# code means using connectionstring
Arjunwalmiki 22-Jan-14 2:54am View
   
i want to execute this string query = "show COLUMNS from " + db1+ "" + str + "";

But i am not get DatabaseName(db1) how can i get it.
Arjunwalmiki 16-Jan-14 6:33am View
   
Yes i am allowing multiple selection option from CheckBoxList1(all database list bind in CheckBoxList1)know you tell me how can handle.
Arjunwalmiki 16-Jan-14 5:36am View
   
i want to use 3 or 2 database as per check and want to bind new checkboxList.
Arjunwalmiki 16-Jan-14 5:34am View
   
y do u want to use checkbox list , u need to use 3 database at a time? y you right that is my query how can i use.
Arjunwalmiki 16-Jan-14 5:31am View
   
Hello D-Kishore your right (but i have total 5 string just like this,Know my problem is how can i use it in code-behind as per checkboxlist selected)
Arjunwalmiki 16-Jan-14 5:26am View
   
thanks for reply know my requirement if you have 1)i am bind CheckBoxList1 from all database from mysql server.My query know i want to check on CheckBoxList(CheckBoxList1)and want to bind new checkboxList as per check.But issue is when i am check on checkboxlist1 how can i get correct string name from web.config file as per selected item in checkboxList.
Arjunwalmiki 16-Jan-14 4:47am View
   
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DropDownList.aspx.cs" Inherits="DropDownList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList3" runat="server" OnSelectedIndexChanged="DropDownList3_SelectedIndexChanged"
AutoPostBack="True">
<asp:ListItem Selected="True">FoxPro
<asp:ListItem>MySQL
<asp:ListItem>Data3

</div>
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataTextField="" DataValueField=""
OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged">

</div>
<div>
<table>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" />
<asp:Button ID="Button3" runat="server" Text="Button" OnClick="Button3_Click" />
</td>

</tr>
</table>
</div>
<div>
<table>
<tr>
<td>
<asp:CheckBoxList ID="CheckBoxList2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList2_SelectedIndexChanged">

</td>
<td>
<asp:CheckBoxList ID="CheckBoxList3" runat="server"
onselectedindexchanged="CheckBoxList3_SelectedIndexChanged"
AutoPostBack="True">

</td>
</tr>
<tr>
<td>
<asp:CheckBoxList ID="TableCheckBoxList" runat="server">

</td>
<td><asp:CheckBoxList ID="CheckFromTable" runat="server">
</td>
<td><asp:CheckBoxList ID="TableCheckBoxList3" runat="server">
</td>
<td><asp:CheckBoxList ID="CheckFromTable3" runat="server">
</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="Dropdownlist1" runat="server">

</td>

</tr>
</table>
</div>
</form>
</body>
</html>
This is my aspx file
Arjunwalmiki 16-Jan-14 4:46am View
   
all are checkboxList Name
Arjunwalmiki 16-Jan-14 3:37am View
   
if you seen in the code i am connecting with database name "arjun"(<add name="mysql" connectionstring="Server=localhost;database=arjun;user id=root;) but is user select database name " bsales="(<add name=" mysql1=" connectionString=" server="localhost;database=bsales;user" id="root;)" or="" database="hr">
Arjunwalmiki 16-Jan-14 3:31am View
   
if you seen in the code i am connecting with database name "arjun"(
Arjunwalmiki 16-Jan-14 3:28am View
   
ASPX:-

<td>
<asp:CheckBoxList ID="CheckBoxList3" runat="server"
onselectedindexchanged="CheckBoxList3_SelectedIndexChanged"
AutoPostBack="True">

</td>
Arjunwalmiki 16-Jan-14 2:15am View
   
Hi Karthik

i am not get right connection from connection String when user select database table from checkBoxList
Arjunwalmiki 16-Jan-14 2:05am View
   
Hi Rajkumar thank you for prompt reply and you valuable time

I am already code inside the CheckBoxList3_SelectedIndexChanged and in the below code i am able to get correct data but my connection string is hard-coded but i want to handle dynamically.So pls let me know.
string strmysqlcon3 = ConfigurationManager.ConnectionStrings["mysql"].ConnectionString;
protected void CheckBoxList3_SelectedIndexChanged(object sender, EventArgs e)
{
MySqlConnection myconn = new MySqlConnection(strmysqlcon3);
string str = string.Empty;
DataSet ds1 = new DataSet();
foreach (ListItem li in CheckBoxList3.Items)
{
if (li.Selected)
{
myconn.Open();
str = li.ToString();
string query = "show COLUMNS from " + str + "";
MySqlDataAdapter mydata = new MySqlDataAdapter(query, myconn);

mydata.Fill(ds2,str);
myconn.Close();
}
int p = 0;
foreach (DataTable dt in ds2.Tables)
{
if (p == 0)
{TableCheckBoxList3.DataSource = ds2.Tables[0];
TableCheckBoxList3.DataTextField = "Field";
TableCheckBoxList3.DataValueField = "Field";
TableCheckBoxList3.DataBind();

}
if (p == 1)
{

CheckFromTable3.DataSource = ds2.Tables[1];
CheckFromTable3.DataTextField = "Field";
CheckFromTable3.DataValueField = "Field";
CheckFromTable3.DataBind();
}
p++;

}

}


}
Arjunwalmiki 16-Jan-14 1:41am View
   
Rajkumar Thank you for reply
i want to select single connectionStrings when user check in checkboxlist.
Arjunwalmiki 6-Apr-13 8:14am View
   
if you people want to see demo so go to http://www.sensirion.com/en/products/humidity-temperature/download-center/ this website u received there same EXE i want the same.
Arjunwalmiki 6-Apr-13 8:13am View
   
ThePhantomUpvoter :- i am received new task for me so i don't know how to start i just finish how to read data from serial port rs232 can it is same or ? just give me start .
Arjunwalmiki 6-Apr-13 4:53am View
   
Kenneth Haugland can u tell me how can open file and read it and save in csv formate
Arjunwalmiki 4-Apr-13 8:26am View
   
ryanb31 thank you i will take care of it pls let me know solution if u know or vs2003.
Arjunwalmiki 23-Jan-13 4:00am View
   
hello thank you for reply

But i thing you have not see my code proper way i was pass the string strto="";

and use the join and email address need from database. So ple tell me correct solution.
Arjunwalmiki 4-Jan-13 5:18am View
   
i am use string baudRate=string.empty; but same error
Arjunwalmiki 4-Jan-13 5:14am View
   
sir as u understand very well so know come to point my query is i want to create a master program just u change in device management PortName ,BaudRate ,Parity,DataBits,StopBits,Handshake and no need to change the code in my program my program is capture everything from system whatever user set in that and read-data from comport so know tell me wt is correct code i have already post my code in the 1st time
Arjunwalmiki 4-Jan-13 4:43am View
   
serial port is working but not received any baudRate
Arjunwalmiki 4-Jan-13 4:17am View
   
hello Prashant Srivastava LKO i am also have same query pls let me know all code if u resolve the problem
Arjunwalmiki 4-Jan-13 0:14am View
   
if i am using above code than i was not received any output
Arjunwalmiki 3-Jan-13 4:13am View
   
can u write full code how can i use it
Arjunwalmiki 3-Jan-13 2:35am View
   
hello this programing is data read from comport if my code are as below i was received result 9600 it is default BourdRate but i was set 2400 so i need 2400 so let me confirm public static int SetPortBaudRate(int defaultPortBaudRate) { string baudRate; Console.Write("Baud Rate({0}): ", defaultPortBaudRate); baudRate = Console.ReadLine(); if (baudRate == "") { _ baudRate = defaultPortBaudRate.ToString(); } return int.Parse(baudRate); }
Arjunwalmiki 3-Jan-13 2:18am View
   
but if i was set
string baudRate="1";
than i was received result is 1 but the sys i was set 2400 so need result 2400 how can it come
Arjunwalmiki 3-Jan-13 2:16am View
   
i was set
string baudRate="0";

know error is
Positive number required.
Arjunwalmiki 3-Jan-13 2:09am View
   
string baudRate="";
baudRate = baudRate.Trim();
_serialPort.BaudRate =Convert.ToInt32(baudRate.ToString());
defaultPortBaudRate = Convert.ToInt32(baudRate.ToString());

still same error
Arjunwalmiki 3-Jan-13 2:07am View
   
hello this programing is data rear from comport

if my code are as below i was received result 9600 it is default BourdRate but i was set 2400 or etc so i need this so let me confirm

public static int SetPortBaudRate(int defaultPortBaudRate)

{
string baudRate;

Console.Write("Baud Rate({0}): ", defaultPortBaudRate);
baudRate = Console.ReadLine();

if (baudRate == "")
{
_ baudRate = defaultPortBaudRate.ToString();

}
return int.Parse(baudRate);
}
Arjunwalmiki 3-Jan-13 2:01am View
   
if i am try this it is nor working same error
Convert.Tostring(baudRate)
Arjunwalmiki 19-Dec-12 2:00am View
   
hello i was find new program

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;
using System.IO;
using System.Diagnostics;
namespace nms
{
public class cls
{
[DllImport("user32.dll")]
private static extern int ShowWindow(int Handle, int showState);
[DllImport("kernel32.dll")]
public static extern int GetConsoleWindow();
static void Main(string[] args)
{
int win = GetConsoleWindow();
ShowWindow(win,0);
Process.Start("myfile.exe");
System.Threading.Thread.Sleep(50000);
Process.Start("http://myweb.com");
}
}
}

how to apply in our program pls let me know
Arjunwalmiki 19-Dec-12 0:13am View
   
to all pls let me how can i resole it
Arjunwalmiki 18-Dec-12 13:14pm View
   
hey actually i was not so expert in console application


but find the some code


using System.Runtime.InteropServices;



...

[DllImport("user32.dll")]

public static extern IntPtr FindWindow(string lpClassName,string lpWindowName);



[DllImport("user32.dll")]

static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);



...



//Sometimes System.Windows.Forms.Application.ExecutablePath works for the caption depending on the system you are running under.

IntPtr hWnd = FindWindow(null, "Your console windows caption"); //put your console window caption here

if(hWnd != IntPtr.Zero)

{

//Hide the window

ShowWindow(hWnd, 0); // 0 = SW_HIDE

}





if(hWnd != IntPtr.Zero)

{

//Show window again

ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA

}
Arjunwalmiki 18-Dec-12 13:10pm View
   
i know it possible but don't know how
Arjunwalmiki 18-Dec-12 13:08pm View
   
but it is possible i don't know but it is possible
Arjunwalmiki 18-Dec-12 13:05pm View
   
yes i don't want to display the command prompt window only want result
Arjunwalmiki 18-Dec-12 12:54pm View
   
pls if u know let me know correct solution
Arjunwalmiki 18-Dec-12 12:48pm View
   
i was done above trick but output not come pls provide me correct trick what can i do for this
Arjunwalmiki 18-Dec-12 7:32am View
   
thank u very much i will test it and let u know result.
Arjunwalmiki 18-Dec-12 7:25am View
   
sir i have already mention in above i am develop the program in console application not in web page so can it is work proper way when i was change property setting change the output type from Console to Windows app.
Arjunwalmiki 18-Dec-12 7:13am View
   
but it is my console application program can i have received same output those received in console program?
Arjunwalmiki 18-Dec-12 7:08am View
   
can i follow the below step or can is this right trick.

http://cs.hubfs.net/topic/None/59579
Arjunwalmiki 15-Dec-12 13:18pm View
   
sir i am find out the Baud Rate 2400 is correct some time my program read data or some time not read
Arjunwalmiki 15-Dec-12 4:31am View
   
<pre lang="c#">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.IO;



namespace PortDataReceived
{
class Program
{
static void Main(string[] args)
{
SerialPort mySerialPort = new SerialPort("COM1");
if (mySerialPort.IsOpen == true) mySerialPort.Close();
mySerialPort.BaudRate = 2400;
mySerialPort.Parity = Parity.None;
mySerialPort.StopBits = StopBits.One;
mySerialPort.DataBits = 8;
mySerialPort.Handshake = Handshake.None;
mySerialPort.Open();
Console.WriteLine("Press any key to continue...");
Console.WriteLine();
mySerialPort.ReadTimeout = 500;
string indata = mySerialPort.ReadExisting();
if (string.IsNullOrEmpty(indata))
{
FileStream fs = new FileStream(@"c:\arjun.txt",FileMode.Append,FileAccess.Write);
try
{

StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("0");
sw.Close();
}
finally
{
fs.Close();
}

}
else
{
StringBuilder builder = new StringBuilder();
for (int i = 0; i < indata.Length; i += 8)
{

string section = indata.Substring(i, 8);

int ascii = 0;
try
{
ascii = Convert.ToInt32(section, 2);
}
catch
{
Console.WriteLine("Current Weight : " + section.ToString());
FileStream fs = new FileStream(@"c:\arjun.txt", FileMode.Append, FileAccess.Write);
try
{
StreamWriter sw = new StreamWriter(fs);

foreach (char c in section)
{
if (Char.IsLetterOrDigit(c))
{
builder.Append(c);
}
}

sw.WriteLine(builder.ToString());
sw.Close();
break;
}
finally
{
fs.Close();

}

}

}
}
// Console.WriteLine(builder.ToString());
Console.WriteLine(indata);
Console.WriteLine("Data Received:");
Console.Write(indata);
Console.ReadKey();
mySerialPort.Close();
}
}
}


</pre>


hello all the above is my code in this code i am read data from com port but problem is i was received 6 to 7 zero than received actual data from comport i was not under what was problem in my code pls let me know i was very thank full to all.i want solution on priority pls
Arjunwalmiki 4-Dec-12 5:12am View
   
i am connecting with weighing machine.
Arjunwalmiki 4-Dec-12 2:16am View
   
Sir i am using rs232 male port and the way bridge port is also male port so use the female to female cable for connection
Arjunwalmiki 4-Dec-12 2:10am View
   
Sir this is my 1st project i am new in .net so pls explain me proper way than i will do proper change in my project
Arjunwalmiki 4-Dec-12 2:10am View
   
Deleted
Sir this is my project i am new in .net so pls explain me proper way than i will do proper change in my project
Arjunwalmiki 4-Dec-12 2:01am View
   
It is working but data not receive from com port or i was not receive any error or how can i save output automatically at my desktop in the txt file.when i was press enter
1 st output Available port name.
2nd out when press enter bound rate 9600.
3rd out when press enter Available parity.parity<none>.
4th Data bite 8.
4th out when press enter Available stop bite.
5th out when press enter Available Handshake.
6th Name
7th Quit to exit