|
You cannot directly create a text file from the database text.You will have to read it and right it to the file.(Of course you can use things like DTS package to export values to text file directly)
|
|
|
|
|
How to put in web services to a smartphone device. The code t do that.
Thank you
|
|
|
|
|
halalalal wrote: How to put in web services to a smartphone dev
Are you asking how to HOST a web service in a smart phone?? Or are you asking how to CALLL a web service??
AFAIK, it's not possible to host a web service on a smart phone.
|
|
|
|
|
form2 is mdi child form of form1.there is a listview control and a search button on form2.when execute the project, mdi parent form(form1) loads and when click on the form2 menu, form2 loads and data shows in the listview based on criteria. when click the search button of form2, a new form form3 opens which in not mdi child form. on form3, a textbox and a button(name-search).in form3,i give the text in textbox existing in listview column of form2 and click on button(name-search). it should dispay record on the same listview of form2,when form2 activates.when form3 close, form2 gets activated.
code of form2 button
public static string check="1";
form3 objFrm3=new form3();
objFrm3.show();
code for form2_activated event
public void form2_Activated(object sender, EventArgs e)
{
if (check != "1")
{
string records = form3.record;
string sqlQuery = "select * from emp where ename like '" + records + "'";
int count = listView1.Columns.Count;
search(sqlQuery, count);
}
private void search(string sqlQuery, int count)
{
SqlConnection objCon = new SqlConnection(objFunction.strConn);
SqlDataAdapter objAdapter = new SqlDataAdapter(sqlQuery, objCon);
DataSet objDs = new DataSet();
objAdapter.Fill(objDs, "f");
listView1.Items.Clear();
for (int i = 0; i < objDs.Tables[0].Rows.Count; i++)
{
DataRow objDr = objDs.Tables[0].Rows[i];
ListViewItem objLv1 = new ListViewItem(objDr[0].ToString());
for (int j = 1; j < count; j++)
{
objLv1.SubItems.Add(objDr[j].ToString());
}
listView1.Items.Add(objLv1);
}
listView1.Items[0].Focused = true;
}
code of form3 of button(name-search)
public static string record=textBox1.Text;
form2.check = "2";
form2 objFrm2 = new form2();
objFrm2.form2_Activated(sender, e);
this.Close();
best regards,
mukesh
|
|
|
|
|
Hello. I have an application in VS 2005 that I must migrate to VS 2003 (what a great upgrade is 2005 btw), and I see that there is no dataset.CreateDataReader method.
Is there other way to do that? Do you know from other implementation I can find anywhere?
Regards,
Diego F.
|
|
|
|
|
One way would be to miss out the dataset and manually create a DataReader using ExecuteDataReader() on the command.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If think if you are migrating backwards you will find a lot of things that didn't exist in the previous version.
The best workaround that I can suggest is that all DataReaders implement the IDataReader interface. Create your own class that implements the IDataReader interface that has a constructor that is a DataSet.
|
|
|
|
|
Hi , I need a CALLER ID Component for c#,
Plz Send to Me
|
|
|
|
|
Check whether the following link is useful
http://www.codeproject.com/useritems/CShart_TAPI_3x.asp
*jaans
|
|
|
|
|
Hi,
How can i send a message like MouseDown message without using win32 apis inC#.
Vikas Maan
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
Hi,
How can i send a message like MouseDown message without using win32 apis inC#.
|
|
|
|
|
have a look in to this http://msdn2.microsoft.com/en-us/library/ms171548.aspx
|
|
|
|
|
I want to search a file from server and want to copy it to the local disk.
how it is done?
|
|
|
|
|
You can search for a file.using Directory.GetFiles(FileName,SearchPattern);
And copy to local system using ftp request and response classes in System.Net.
Mean while what is your application is a client server apps or a web applicaiton ?
|
|
|
|
|
My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk.
I tried to searc using using Directory.GetFiles(FileName,SearchPattern);
but it is not at all serching.
|
|
|
|
|
Plz help me for the above..............
|
|
|
|
|
P_Elza wrote: not at all serching
Hope you are checking if the directory is existing using
Directory.Exists ?
P_Elza wrote: search the particular element from an xml file
Are the innertext's value assigned to the intended variables?
Probably debugging the app will help you understand where it fails.
|
|
|
|
|
Tis is working if the file is in my hard disk itself.
but not when it comes to server. If i map the server i can search.like
y:\\my folder\\myfolder
am tring to make an exe. different people will map to different drive.
so i cant give like that.should give like \\server\\serverfolde\\folder\\
|
|
|
|
|
Well, that will never work because a server must start with a double slash, so in your syntax this would be \\\\server\\serverfolde\\folder\\. You can, of course, prefix this with the @ sign so this becomes @"\\server\serverfolde\folder\".
Now, your application will need to have permissions to work with these folders - make sure that it has the permissions to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi
you can take the toolbox from openfiledialogbox1
|
|
|
|
|
I am tring to make an exe.
|
|
|
|
|
Hi,
I want to delete data from datbase by entering a year in text box. If the there no data then i want to show "the selected date does not exist". How can i do this? pls help me?
Please write code here........................
|
|
|
|
|
It should look something like this.
SqlConnection con = new SqlConnection(connecitonstring);
SqlCommand cmd = new SqlCommand("delete from table where year = @year",con);
cmd.Parameters.Add("@year",SqlDbType.Int).Value = int.Parse(TextBox1.Text);
if(cmd.ExecuteNonQuery() > 0)
{
Console.WriteLine("Record deleted successfully");
}
else
{
Console.WriteLine("No data found");
}
|
|
|
|
|
in select statement
strdelete="delete from tablename where datefield='date'
objsqlconn=new sqlconnection("user id=sa;password=;data source=servername")
objsqlconn.open
try
Dim vbmsg As String
vbmsg = MessageBox.Show("Are u sure to delete this record", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
If vbmsg = vbYes Then
strdelete = "delete from tablename where datefield='date'"
objsqlcmd = New sqlcommand(strdelete, objsqlconn)
objsqlcmd.executenonquery()
Else
MessageBox.Show("There is no field exits")
End If
catch (ex as exception)
exception(ex.message)
end try
|
|
|
|