|
Hi,
I want to put the value of a column from a row in a datatable where I know the row number ie
string CName = [row=1, column=Names in datatable=dtClubs]
What goes into the [ .....] part?
TIA
Glen Harvy
|
|
|
|
|
DataSet dsTemp = new DataSet(); <br />
DataTable Tables = new DataTable(); <br />
dsTemp.Tables.Add(Tables);<br />
string data = dsTemp.Tables[0].Rows[0][0].ToString();
|
|
|
|
|
|
DataSet dsTemp = new DataSet();
DataTable dtMyClub= new DataTable();
dsTemp.Tables.Add(dtMyClub);
string data = dsTemp.Tables[0].Rows[0]["ClubName"].ToString();
//result
// string data = "North Ponly Club"
or can u set here ur piece code to see what are u want to do
-- modified at 9:06 Saturday 22nd July, 2006
|
|
|
|
|
Thanks for the help.
I need to work out a couple of other things as well.
Glen Harvy
|
|
|
|
|
Hi,
I am facing an odd problem. I have library class that fills up binary data in a string that is passed by ref to one of its function. The problem is when i convert the data into byte[] using the function System.Text.Encoding.Uncode.GetBytes();
I dont get the actual binary data which the library program has given to me.
I checked the length of the string before converting it into byte and it was the same as was sent by the library program. But when i convert it into byte[], not only the size is different but also the data is changed. I think some of the characters in the data are not valid Unicode data.
Is there any othe method which can give me the raw byte[] without applying any encoding scheme.
Like: byte[] GetByteData(string strData);
Regards
-Mursil
Take a very good care of Yourself.
Sayed Ahmad Mursil
|
|
|
|
|
Hello
There are more encoders than just Unicode. Did you try them?? Including Encoding.Default
You wouldn't want to put your string in a for loop and read it byte by byte, would you?
Regards
|
|
|
|
|
I have tried this method also.
But Encoding.Default basically returns Unicode encoding reference by default.
so it doesnot server the purpose.
Is there any open source library for other encoders.?
i.e which doesnt encode any thing. Just give me the exact byte[] stored in the string.???
Take a very good care of Yourself.
Sayed Ahmad Mursil
|
|
|
|
|
Hello
How would anybody know how your library is storing the bytes? I mean if you have byte sequence 1,2,3,4 It culd be stored as:
01, 02, 03, 04
or
01, 00, 02, 00, 03, 00, 04, 00
Or for whatever it's worth it, it could be comma delimited (Dec for comma is 39):
01, 39, 02, 39, 03, 39, 04, 39
It depends mainly on your library, and how it fills the string.
Regards
|
|
|
|
|
You are absolutely right.
Actually the library program is a COM program. It captures an image and then send the image data to by filling the binary image data in the ref string. I am getting the complete data but when i try to get the bytes out of the string, it is not the same as those transmitted by the library program.
( I have already done logging at both ends to compare the binary data. Also i have a lmitation that i cannot change the interface of my library program).
I am sure that the raw image data doesnot follow any of the encoding shceme you have mentioned. The last option for me is to encode the data in the library before sending it to the main application. But this is the last thing i wana do bcz it will almost doubles the size of the data.
So I am looking for an alternative solution in this regard that can work without
encoding the image.
Thanx for your time and support...
Regards..
|
|
|
|
|
Hello
Mursil wrote: last option for me is to encode the data in the library before sending it to the main application
Wait a minute!! Should I understand from this that you wrote that library?? If so, why not passing the data as a bytes array from the begining?
Mursil wrote: It captures an image and then send the image data to by filling the binary image data in the ref string
If it's a 3rd party library and this is what it does. Why can't I see anything special about it?? I mean you can capture an image from the screen as easy as one method: Graphics.CopyFromScreen() , if you are capturing from a camera or a scanner, then maybe the problem is in the library?? How did you know that the data sent by the library is valid?
Regards
|
|
|
|
|
Hi,
Just wanted to ask if any body knows how to add context menu handlers for your custom application, for example, if my application is registered with .abc then there are some verbs that I can set which will work on .abc file. What I am asking is that how to add context menus when the user clicks to any file extension, those menus should appear and then I can set the command parameter for those menus in registry to my own custom application... can any body help
Thanks in advance...
regards,
Waqas
|
|
|
|
|
With a .Net deployment project, you can add new file types to the registry and specify their actions and what applications are invoked when used. But if you're looking to create your own context menu, that's beyond the scope of .Net, and I'm not sure what all you might have to do with the registry to accomplish that.
|
|
|
|
|
hai all.
how to check whether a system is there in a particular network using C#.net... or how can i access a system in the netwaork using c#.
Regards
|
|
|
|
|
what you want to access.
1. Any DB on other machine
2. Any web Service on other machine
3. Any Window service
4. Any remoting Object
5. Serialization
6. Operate other system
7. Extract folder information
8. Display like remote desktop
9. There are many more to go.. what you exactly wants ?
Rizwan Bashir
|
|
|
|
|
hai..
i just want to extract shared folder information of remote system...
Regards
|
|
|
|
|
I'm looking for pointers to code or documentation that will allow me to determine if a file can be opened. I don't mean if the file exists (that is easy enough) but if the file can actually be opened.
I had thought about opening the file in exclusive mode then closing it again, but I don't really want to do that because it would throw an exception if the operation failed (which would at least tell me if it is possible) and I don't regard a failure as exceptional. So, I obviously don't want the overhead of throwing and catching an exception.
|
|
|
|
|
As far as I know the only way is to actually try opening the file
only two letters away from being an asset
|
|
|
|
|
Does anybody know what is the problem in the below code. The InPtr returned by the funcion is always 0 means null. Why?
////////////////
public class ThumbnailExtractor
{
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acdbGetPreviewBitmap@@YAPAUtagBITMAPINFO@@PB_W@Z")]
extern static private IntPtr acdbGetPreviewBitmap(string filename);
static Bitmap GetBitmapFromDwg(string filename)
{
return Marshaler.BitmapInfoToBitmap(acdbGetPreviewBitmap(filename));
}
public Bitmap GetImage(string filename)
{
return GetBitmapFromDwg(filename);
}
}
///////////////////
Thanks in advance
|
|
|
|
|
Not sure where this acdb17.dll is coming from, but the EntryPoint is looking really strange.
In most cases you can simply p/invoke functions from Win32 DLLs by just declaring the static method with the same name as the function in the DLL.
The EntryPoint attribute is only neccessary if you want to (or have to) name you function differently.
So I'd suggest trying:
[DllImport("acdb17.dll")]
extern static private IntPtr acdbGetPreviewBitmap(string filename);
Does it work then?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Im building a Search facility and want to return a set of results (Done!)
The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes:
a Sample:
string ConnectionString = "Data Source='db.sdf';";
SqlCeConnection connection = new SqlCeConnection(ConnectionString);
connection.Open();
string strLastName = textBox1.Text;
string strPostCode = textBox2.Text;
string strEmail = textBox3.Text;
if (!(textBox1.Text == null))
{
string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'";
SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString);
DataSet ds = new DataSet();
da.Fill(ds, "Eaddress");
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Eaddress";
}
i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2.
example would help very much!!
Palestine
|
|
|
|
|
Look up textbox databinding.
|
|
|
|
|
Can someone explain this with an example of why you need it as part of your own implementation of the Virtual Path Provider class. I have read this over and over in MSDN and other articles and do not get what it's use is in a pratical example.
Palestine
|
|
|
|
|
Hello,
I was thinking the other day about how I would solve the following problem, but I just couldn't seem to come up with a really logical solution... or at least what I would think is a best practice. How would you handle the following?
Say I have winform client apps... any number of them. Lets say that this app has a couple web services. Okay, now lets say that one of the web service is like a broker web service... it also contains other web services. The client isn't aware of all the web services the broker service is hitting, the broker is responsible for knowing that. The point here is that we have a web service which may hit another web service, could be anything. Now, here's the hard part... getting all of the errors in case one happens. So client requests data from Service1. Service one then hits Service2, Service3 and Service4. Service3 errors out because the server that it's on is down. Service4 errors out because of a database issue or something. I want to return something back to the client listing all of the details of why the transaction failed (like in a log file or something), like
Success: Transaction to Service1 was successful
Success: Transaction to Service2 was successful
Error: Could not access Service3.
Error: Duplicate Primary Keys in Service4.
How do I handle this? Lets take it to another level and say that Service2 in itself might contain other services, so the transaction to Service2 was successful, but the transaction to Service2a failed for some reason.
The trick is keeping a single log file that contains all of the details on why various services failed, even if those service contain services which may have failed for some reason. What's the best way to handle something like this? I can't have every method return a bool if it passes or fails because it might already have a return value... So I can't just call GetData on Service2 and return a bool whether it passed or failed because it might already return a dataset... Does this make sense?
Keep in mind this is hypothetical, but I am just wondering what the best practice is in handling this type of scenerio.
Thanks!
Palestine
|
|
|
|
|
Hello
In your scenario, I believe the best practice would be messages. Each message contains the sender info, and the error message. The protocole, or implementation is totally up to you. There are million ways to communicate between different applications and services.
Hints:
- You can return success/failure messages, or only failure messages.
- You can put your messages in a queue and check it periodically, or handle it promptly.
- You can send the error message in the service output, or send it in a private stream.
I hope this would throw some light
Regards
|
|
|
|