Hi I have a datagridview (in a windows application) which its data comes from executing a StoredProcedure. This SP joins two tables and derives the data needed. what is the role of dataview in inserting a new row and updating dgv rows (and validating them) and delete rows? Can a dataview save these changes? and somehow apply them to the DB all toghether? I've done these before by applying every change to the DB and refill the dgv after that. But I think it's not the right way. and I didn't find a full sample that can guide me through this. next, to search in dgv and find the word that user wants, and somehow specify the found results (for example bolding the found words) in dgv. how it should be done? by dataview? please help
mahraja
Posts
-
dataGridView and dataView -
search part of key in the SortedDictionaryHi I have a SortedDictionary and I need to find the first key match with the character(s) given. For example, if c has been pressed, I need to get the first word in the SortedDictionary that starts with 'c'. Is that possible? I've read about
SortedDictionary< TKey, TValue> .First Method
and
Enumerable.First< TSource> Generic Method (IEnumerable<TSource>, Func<TSource, Boolean>)
in MSDN, but I can't understand it.
-
assign width to a select elementof course i did. but it has no effect on the width of select element since it stretches itself to fit the longest option. i set the width 100px, and when i inspect it in the browser, it is 400px!!!
-
assign width to a select elementhi i have a select element that is created by javascript code and its options come from db. it works fine, but the problem is that the select element stretches itself to fit the longest option. and doesn't accept the width i specify/assign for it. what should i do?
-
Contains method doesn't work on BindingList<t></t> [modified]yes, no matter the list has the item or not, it always returns false, i have checked that so many times :(
-
Contains method doesn't work on BindingList<t></t> [modified]yes, sure bindinglist has ListItems. Because it was in a long loop, i didn't add it to the code here. sorry it was not clear
-
Contains method doesn't work on BindingList<t></t> [modified]Hi i have a BindingList and i want to check if the list contains an object of ListItem. But the Contains method of the BindingList<> always returns false. can anyone tell me why? and what should i do?
BindingList<listItem> normalExtItems = new BindingList<listItem>();
//elements are added to the bindingList here
extItem = new listItem(Number,Name,Id));
if(normalExtItems.Contains(extItem))//always returns false
{
//do sth
}modified on Sunday, November 30, 2008 5:54 PM
-
how transmit array elements to a table of database at onceI have read somewhere that I should use union all like this:
use myDb insert into myTable (columnName1,columnName2...) select row1value1,row1value2... union all select row2value1,row2value2... union all . . .
but I don't know how pass the arrays to the stored procedure and how perform these in a loop to add all array elements automatically...:confused: -
how transmit array elements to a table of database at onceHi I have 4 arrays which i want to insert them into 4 columns of a table of my sql server 2000 database, and it should be done at once, not inserting one by one. How can i do this?
-
ErrorProvider icon disappear after fixing the errorHi I have used an ErrorProvider in my form, and it works truly, but when I run my project, after fixing the error of the textbox input, the errorprovider icon still exists and blinking. how the error icon disappears after fixing the error?
-
write file questionHi Is it possible to write in a text file with a color other than black? How?
-
regular expression problem// get the value with: mc[i].Groups["var1"].Value;
Thanks a lot, that was so useful :rose:modified on Wednesday, June 25, 2008 1:50 PM
-
regular expression problemHi The pattern is sth like this:
^-?((?<X>[0-9]{0,8})/(?<Y>[0-9]{0,15})|(?<X>[0-9]{0,8}))\*?$
and I want to have the variables in their named groups as following X=... Y=... I don't know how to use MatchCollection, CaptureCollection ,etc. Can anyone help me? :confused: -
socket usage permissionHi I recieve this exception: "Only one usage of each socket address (protocol/network address/port) is normally permitted" I should get several files from an ftp server. I implemented it by sockets so: create the datasocket, recieve the file and then close data socket. But the next time I do this for another file(create data socket with Endpoint (the same local address/another port)), i recieve this exception message when Binding the socket. Can anyone tell me why? And the way to solve that? (the code, if necessary)
public void download(string remFileName, string locFileName)
{
if (!logined)
{
login();
}setBinaryMode(true); Console.WriteLine("Downloading file " + remFileName + " from " + remoteHost + "/" + remotePath); if (locFileName.Equals("")) { locFileName = remFileName; } if (!File.Exists(locFileName)) { Stream st = File.Create(locFileName); st.Close(); } FileStream output = new FileStream(locFileName, FileMode.Open); createDataSocket(true); if (dataSocket != null) { throw new SocketException(); } //\*\*\*\* sendCommand("RETR " + remFileName); if (!(retValue == 150 || retValue == 125)) { throw new IOException(reply.Substring(4)); } //\*\*\*\* dataSocket = listeningSocket.Accept(); listeningSocket.Close(); listeningSocket = null; if (dataSocket == null) { throw new Exception("Winsock error: " + Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error())); } while (true) { bytes = dataSocket.Receive(buffer, buffer.Length, 0); output.Write(buffer, 0, bytes); if (bytes <= 0) { break; } } output.Close(); if (dataSocket.Connected) { //dataSocket.Shutdown(SocketShutdown.Both); dataSocket.Close(); dataSocket = null; } Console.WriteLine(""); readReply(); if (!(retValue == 226 || retValue == 250)) { throw new IOException(reply.Substring(4)); }
}
public void createDataSocket(bool flag)
{
try
{
listeningSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
}
catch (Exception e)
{
ftpLog(e.Message);
throw new IOException(e.Message);
}string localAddress = clientSocket.LocalEndPoint.To
-
normal FTP transfer? [modified]Actually this is my code for downloading file from ftp server
public void download(string remFileName, string locFileName, Boolean resume)
{
if (!logined)
{
login();
}setBinaryMode(true); Console.WriteLine("Downloading file " + remFileName + " from " + remoteHost + "/" + remotePath); ftpLog("Downloading file " + remFileName + " from " + remoteHost + "/" + remotePath); if (locFileName.Equals("")) { locFileName = remFileName; } if (!File.Exists(locFileName)) { Stream st = File.Create(locFileName); st.Close(); } FileStream output = new FileStream(locFileName, FileMode.Open); createDataSocket(true); if (dataSocket != null) { throw new Exception(); } dataSocket = listeningSocket.Accept(); //################### listeningSocket.Close(); listeningSocket = null; if (dataSocket == null) { throw new Exception("Winsock error: " + Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error())); } sendCommand("RETR " + remFileName); if (!(retValue == 150 || retValue == 125)) { throw new IOException(reply.Substring(4)); } while (true) { bytes = dataSocket.Receive(buffer, buffer.Length, 0); output.Write(buffer, 0, bytes); if (bytes <= 0) { break; } } output.Close(); if (dataSocket.Connected) { dataSocket.Close(); } Console.WriteLine(""); readReply(); if (!(retValue == 226 || retValue == 250)) { throw new IOException(reply.Substring(4)); } }
and in the line signed with //########## the execution stops( or blocks, whatever). What can I do except implementation of threading?
-
normal FTP transfer? [modified]sorry i can't understand what u mean, i should implement what?
-
normal FTP transfer? [modified]Hi everyone Does normal (not passive) FTP download needs threading? I mean when I make a data socket (bind, listen and then accept it) socket.accept is blocking and my program blocks and does no work anymore. should i seprate the socket.accept & the download process in two threads????
modified on Monday, May 19, 2008 4:57 PM