|
Hi there,
Trim() i used ......
Its the first time...........like a form with a binding navigator directly picking db values. we use trim when we are sending the records to db........
Using binding navigator it calls a Fill() function on tableadapter..and retrieves records from dataset
Is there a way to edit default fill query in C#....I think if i can edit the default query i can add DB Trim function and my problem will be solved........Can anybody know how to edit Fill query of a binding navigator or dataset
pls help
|
|
|
|
|
I run the query in access and it populates results fine. It is a simple select command. I think I might just have the code wrong somewhere just can't figure it out. Please help. The headers populate in the datagridview but none of the data does.
private void QueryTest()
{
pcDataConn = Utility.DBConnection();
try
{
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = pcDataConn;
cmd.CommandText = "FHD_qry";
DataSet ds = new DataSet();
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
adapter.Fill(ds);
DataTable dt = ds.Tables[0];
pcDataview.DataSource = dt;
int totalResults = dt.Rows.Count;
Resultslabel.Text = "Results: " + dt.Rows.Count.ToString();
if (totalResults > 0)
{
Exportbutton.Enabled = true;
}
else
{
Exportbutton.Enabled = false;
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
pcDataConn.Close();
}
|
|
|
|
|
I figured it out. It was the whole wildcard through the OleDb connection. I just changed the ?'s to #'s in the stored procedure and it worked fine.
|
|
|
|
|
Hello all,
I'm building this app. that stores list of files in a directory in a database (called an image in the app's terminology) and then lets you browse the directory even if it has been deleted. Now my problem is that, I want to provide search facility, so that a user can search the files. The user would be able to search within as many images as he likes simultaneously.
Now I can't figure out, how to implement the UI for the search results. The search input will be taken through a separate dialog box. But I really can't decide about the UI mechanism. I mean, I want everything to be very clear & concise. Further, I want the search results to be visible in the same window. Please don't suggest using tabs . Please help
Here[^] is a pic of the current UI.
Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
|
|
|
|
|
keep data in any source like DataTable, XML...then when user search read the data from source and add only those you want. And in DataTable you can use Select() to filter the result.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi Xmen
My problem is not how to implement searching but, how to display the search results. I've already formulated the background searching algo. but, I can't think of how to integrate the search results in the main window.
Excuse me for buttin' in, but I'm interrupt driven.
|
|
|
|
|
whats the problem...you can use DataGridView to show the result.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi There
I am using win form in C#, Access database for my project.
I have a situation whereby I need to update a primary key.
In my table, I have these columns:
[U]UserID[/U], FName, LName, Address
I have the following method
private void btnUpdateCigreID_Click(object sender, EventArgs e)
{
OleConn.Open();
string updateSql = "UPDATE Membership SET Membership.UserID = '" + txtUserId.Text + "' Where ((Membership.UserID )= ' " + txtTempID.Text + "' )";
OleDbCommand OleCmd = new OleDbCommand();
OleCmd.CommandText = updateSql;
OleCmd.Connection = OleConn;
OleCmd.ExecuteNonQuery();
int R = OleCmd.ExecuteNonQuery();
OleConn.Close();
}
I wonder why I see int R = 0. There is one record execting with old UserID. I don't get any error, but table is not updating.
Is there any other methods to update a primary key using the old primary key? Thank You in Advance.
Thank you
|
|
|
|
|
mistake
((Membership.UserID )= ' " + txtTempID.Text + "' )";
correct
((Membership.UserID )= '" + txtTempID.Text + "')"; // removed space
more correct
Membership.UserID = '" + txtTempID.Text + "'";
plus use SqlParameter instead
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Make sure you have not kept the ID as the primary key , as primary key may not be updated...
But I am not that damn sure...
But I havent came across such .....
Now for this its better to use a better way to code...
This should be something like this...
I am writing for SQL but its similar for OLE DB...
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn; //Anything you have as SqlConnection object
cmd.CommandText = "Update Membership SET UserID = @UserID";
cmd.Parameters.AddWithValue("@UserID",txtuserid.Text);
int R = cmd.ExecuteNonQuery();
cn.close();
|
|
|
|
|
hi there,
a want to write a simple program that can do auto-Completion in word or notepad, but i don't have an idea of where to start with the auto-Completion, can anyone point me to an article or beter yet tutorial ?
thank's in advance .
|
|
|
|
|
here[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi! You have all seen the word games, which have a grid of letters and you need to find the words.
I've managed to make a program which seeks the grid and finds words, and then compares them to a list of actual words. The problem is that it's too slow. I saw a Dictionary class included int the .NET framework but can I use it for this purpose? And is there any built in class that can be used for a rapid search in a big list??? If not maybe I'm going to have to write my own search method.
The process of searching is done via a BackgroundWorker. If I close the application while the worker is searching will it dispose of the separate thread, or I have to stop it manually??? Once when I experimented with the BackgroundWorker, I closed the application and later it showed me a message saying "Done!"(I made the worker show a message box when it is done working).
Thanks!
Still learning...
|
|
|
|
|
nike_arh wrote: and then compares them to a list of actual words. The problem is that it's too slow.
You'll need to manage any threads you generate, otherwise the process will remain alive.
nike_arh wrote: The process of searching is done via a BackgroundWorker. If I close the application while the worker is searching will it dispose of the separate thread, or I have to stop it manually???
Are you simply running a linear search into a list of thousands of words? If so, I'm not surprised. Thousands of byte-wise comparisons will take a fair while when conducted hundreds of times. If the data is sorted then try running a binary search based on the first few letters. If not try sorting it and building an index into your list.
nike_arh wrote: I saw a Dictionary class included int the .NET framework but can I use it for this purpose?
Dictionary's are handy for associating two lists of information together, namely a key (which must be unique) and a value corresponding to that key. I use them for lookup information all the time such as translating a numeric value into a displayable string.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
Hi,
Threads are either forground or background threads, see their IsBackground property; the difference is each running foreground thread prevents an app from exiting, background threads don't. BackgroundWorker is basically a background thread.
Have a look at HashSet< T> class.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
iam in Developing Desktop application using c#..
i have to print data in Invoice Format. In MSDN i saw about "TabularReport" to print data in Invoice Format.
can anybody give information how can i desing "TabularReport" ?
how can i bind data into TabularReport ?
Thanks in Advance..
murali krishna
|
|
|
|
|
Hi, I programing tapi 3.0 c#, already downloaded the source example from this site, but I'm not succeed to get events from the call. My purpose is to control devices using a phone and computer,
there for when number is pressed I need any event to occur.
The link of the source code:
http://www.codeproject.com/KB/IP/devangpro.aspx[^]
I think that the problem can be in these lines:
TAPI3Lib.ITTAPIEventNotification_EventEventHandler(cn.Event);
tobj.EventFilter=(int)(TAPI_EVENT.TE_CALLNOTIFICATION|
TAPI_EVENT.TE_DIGITEVENT|
TAPI_EVENT.TE_PHONEEVENT|
TAPI_EVENT.TE_CALLSTATE|
TAPI_EVENT.TE_GENERATEEVENT|
TAPI_EVENT.TE_GATHERDIGITS|
TAPI_EVENT.TE_REQUEST);
or in:
public void Event(TAPI3Lib.TAPI_EVENT te,object eobj)
{
switch(te)
{
case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION:
addtolist("call notification event has occured");
break;
case TAPI3Lib.TAPI_EVENT.TE_DIGITEVENT:
TAPI3Lib.ITDigitDetectionEvent dd =
(TAPI3Lib.ITDigitDetectionEvent)eobj;
addtolist("Dialed digit"+dd.ToString());
break;
case TAPI3Lib.TAPI_EVENT.TE_GENERATEEVENT:
TAPI3Lib.ITDigitGenerationEvent dg =
(TAPI3Lib.ITDigitGenerationEvent)eobj;
MessageBox.Show("digit dialed!");
addtolist("Dialed digit"+dg.ToString());
break;
case TAPI3Lib.TAPI_EVENT.TE_PHONEEVENT:
addtolist("A phone event!");
break;
case TAPI3Lib.TAPI_EVENT.TE_GATHERDIGITS:
addtolist("Gather digit event!");
break;
case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
TAPI3Lib.ITCallStateEvent a=
(TAPI3Lib.ITCallStateEvent)eobj;
TAPI3Lib.ITCallInfo b=a.Call;
switch(b.CallState)
{
case TAPI3Lib.CALL_STATE.CS_INPROGRESS:
addtolist("dialing");
break;
case TAPI3Lib.CALL_STATE.CS_CONNECTED:
addtolist("Connected");
break;
case TAPI3Lib.CALL_STATE.CS_DISCONNECTED:
addtolist("Disconnected");
break;
case TAPI3Lib.CALL_STATE.CS_OFFERING:
addtolist("A party wants to communicate with you!");
break;
case TAPI3Lib.CALL_STATE.CS_IDLE:
addtolist("Call is created!");
break;
}
break;
}
}
}
Thanks for any help or advise.
|
|
|
|
|
how to Get label text value from ID in C#
Let give the example first
Inside the body tag
<asp:Label id="Label1" runat="server" Text="Hello world"/>
Inside the script tag using c#
void Page_Load(Object Source, EventArgs E)
{
String test = Label1.Text
}
OK, thats the normal method.
But my problem is I have many Label.
Lets say Label1 until Label10 and I want to get the label value by using loop
Example: hope this kind of code exist, note that getLabelID is not a funtion or even exist, its just something that can get the Label based on its id where the parameter is a string. Is this thing exist?, if not any one have a solution?
void Page_Load(Object Source, EventArgs E)
{
for(int aa=1; aa<=10; aa++)
{
String test = getLabelID("Label" + aa.toString()).Text;
}
}
|
|
|
|
|
Loop round the controls in the page instead - you can use the if (control is Label) check to ensure that the object you've found is a control and you can retrieve the properties of the label by casting the control accordingly, i.e. ((Label)control).Text
HTH
It definitely isn't definatley
|
|
|
|
|
asipo wrote: Is this thing exist?
yes...FindControl() but you have to convert it to Label e.g (Label)FindControl()
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks Xmen.
Here the solution, basically from him.
This is to change the Label99 text from "Hello world" to "My world"
Inside the body tag
<asp:Label id="Label99" runat="server" Text="Hello world" />
Inside the script tag using c#
void Page_Load(Object s, EventArgs e)
{
Label test = new Label();
test = (Label)FindControl("Label99");
test.Text = "My world";
}
|
|
|
|
|
Hi,
I'm trying to get all Files form the Soltion Explorer in Visual Studio.
I'm searched the internet and it found sometthing like that:
EnvDTE80.DTE2 dte2;<br />
dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");<br />
MessageBox.Show(dte2.Solution.FullName, "ok Solution");
The prblem is, that it isn't returnig the Soltion of the current Project but the Solution of the Project where I'm making the VSX programm... And I have no Idea why
|
|
|
|
|
Does anyone have a favourite or know of a solid commercially available TCP/IP library / set of tools for socket based TCP/IP communications?
Thanks in advance for your feedback!
|
|
|
|
|
What exactly do you need it for? What does it need to do? There's a lot of stuff for that already in .NET..
|
|
|
|
|
I am writing an application that communicates with remote display units - I have a working sychronous system - but the error handling, speed and other aspects could be improved upon. The messaging is simple open socket, send text, close socket - I am looking to make it more robust, increase the speed, and perhaps receive more diagnostics on the errors - Also thinking of making it asynch
All without doing a pile of research and coding - if possible.
|
|
|
|