|
Hi,
I am working on a application in that we need to read client information. I stuck some where, i dont want to write a java script as i want to read client information from serveritself.
i have a doubt that,
Can we read the client time and clientzone information without writting a java script?
If anyone can guide me regarding this problem...
Thanks
Vaibhav
|
|
|
|
|
|
Please try the ASP.NET forum, you will get quick responses for this over there.
Salil Khedkar [^]
|
|
|
|
|
I have an application with a number of .NET DataGrid instances. I allow the user to dynamically resize the DataGrids at runtime. When this happens the scrollbar appear and disappear at will. I am sure this is supposed to be a convenience, but in my application it is indeed a nuisance.
Can anyone tell me how to turn on and turn off the scrollbars for a .NET DataGrid?
I am programming in C#, and tried calling ShowScrollBar from the WIN32 API. However, this seems to control a different set of scrollbars which are normally turned off anyway. If I pass a "true" for the last parameter I get two sets of scrollbars - 2 horizontal and two vertical. If I pass a "false", the same old DataGriod scrollbars are still there.
Any help would be appreciated.
Thanks,
Mark Mokris
|
|
|
|
|
|
I've been ripping my hair out for a couple of days with a scrolling issue and so I thought it was time to admit defeat and ask for help
If you notice, in the Visual Studio IDE when you drag the vertical scrollbar up or down, the window moves up or down exactly one line at a time - the small movements inbetween seem to be ignored.
However if you try the same with a richtextbox the window scrolls a very small amount at a time meaning that you might be left with half a line of text showing either at the top or bottom of the window.
How do I go about getting the richtextbox to scroll exactly one line at a time when the scrollbar is dragged?
I've tried all sorts, such as intercepting SB_THUMBTRACK, WM_VSCROLL etc, but I just can't figure out how to do it
TIA.
Cheers,
Paul Wilson
|
|
|
|
|
Im praying this doesn't mean no-one knows
Cheers,
Paul Wilson
|
|
|
|
|
Hallo
I try to write a window application that connect to database with udl.
The connection is O.k (I tested it), but when I want to use it in my code, it failed.
my code:
static SqlConnection con = new SqlConnection();
con.ConnectionString = "File Name=C:\\WINNT\\myConnection.udl;";
con.Open();
I also tried:
con.ConnectionString = @"File Name=C:\WINNT\PrePaidDb.udl;";
and also try to define it in app.setting.
the error is always:
{"Keyword not supported: 'file name'." }
Do someone has any idea.
Thanks a lot
|
|
|
|
|
The SqlConnection class doesn't support the File Name connection string parameter, thus it would fail. You can do this with the OleDbConnection class however:
OleDbConnection conn = new OleDbConnection(@"File Name = c:\test.udl");
try
{
conn.Open();
if(conn.State == ConnectionState.Open)
{
MessageBox.Show("Connection successful.");
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thank you Nick.
The DB is in SqlServer and not in Access, is that means that I couldn't use udl to create connection?
|
|
|
|
|
I believe you can use OleDBConnection for SQL also but its not optimized. Why dont you just store the connection in the config file??
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Thank you everybody.
Finally I found a way to do what I want.
I read the connectionString as a text file.
using (StreamReader sr = new StreamReader("c://WINNT//myConnection.udl"))
{
string line;
//--the connection string is define at the third line of the file
line = sr.ReadLine();
line = sr.ReadLine();
line = sr.ReadLine();
connectionString = line;
}
|
|
|
|
|
Hi,
I have a form with many controls and panels in it. I need to know the location of each control, but when I use the Control.PointToScreen , not always I get the correct answer. I tried to use Control.Parent.PointToscreen, and in some cases it did help.
The problem is that I don't know when to use the Control.Parent.PointToscreen and when to use the Control.PointToScreen .
Can someone please explain me ?
Thanks,
yonit
|
|
|
|
|
|
I need the absolute point relative to the screen.
I have container in container and so on..
my problem is that I don't know what the Control.Parent.PointToScreen refers to and what the Control.PointToScreen refers to.
|
|
|
|
|
hi
could anyone point me to a link or source about how to edit a winforms datagrid cells to a new value,
adding a new row and update those values to the sqldatabase....
i have spent allday searching google all it had was about asp.net datagrid ... nothinf about winforms DataGrid
thanks in advance
bart
|
|
|
|
|
DataGrid Girl listed many articles. ome of them may link you back to CP.
Cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
Assuming you have your external database, create a dataadapter to connect to it. Then generate your dataset. Now set your source of your datagrid to the dataset table you want the grid to represent. To show up the information, use the Fill command from your adapter (it takes the datagrid as a parameter.) Do whatever you want to your datagrid. When you are done, use the Update command from your adapter. This will update your database.
|
|
|
|
|
Hi~
Using remoting, there is server, client and remotable object type. The remotable object is in the client side and invoke methods to send data to server. However, the server don't know the object values. How does the server get the object?
Thanks
|
|
|
|
|
I recommend that you put the remotable object into a "shared" assembly. Depending on what solution you need you can have either singleton, single-call, or client activated mode. The object is hosted on the sever. Whenever you call a method it is actually executed on the server.
Search around on MSDN for more information. Here's a good link for Microsoft QuickStart: samples.gotdotnet.com/quickstart/howto/doc/Remoting/nutshell.aspx[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi
If the object is hosted on the server, then is the client get the object from the server and call methods on the client is the same as call the methods on the server?
If it is correct, can you give some examples.
Thanks!
|
|
|
|
|
Anyone know a good place to find a DLL/Project that I can import into my Solution that allows me to edit an ID3 tag in an MP3?
Currently out there the pickings are slim for anything that updates version 2 tags. I want something simple that I can reference like this:
using ID3Edit;
private void Get()
{
ID3Tag id3Tag = new ID3Tag();
id3Tag.GetV2andV1Tag("C:\\test.mp3");
txtTitleV2.Text = id3Tag.TitleV2;
txtTitleV1.Text = id3Tag.TitleV1;
}
private void Save()
{
id3Tag.TitleV2 = txtTitle.Text;
id3Tag.UpdateV2Tag("C:\\test.mp3");
}
I would be willing to pay $100 or so if someone could create a DLL like this for me within the next few days. I bet many other people out there are willing to pay for it as well. If you know of something that's already created in C# that is as easy to use as my above code, email me right away. I just don't have the time or knowledge to put something like that together.
Email me for details if you want the job or if you have a DLL like this:
Ethan
ethanwa@comcast.net
|
|
|
|
|
I will get you started and then let you finish up, this is really not a difficult task. If you read ID3 made easy[^], they explain the byte layout for the ID3 tag within a file. If you have further questions please feel free to post here. The following should get the ID3 tag out of your file:
class ID3Tag
{
public string title;
public string artist;
public string album;
public string year;
public string comment;
public string tracknumber;
public string genre;
}
private ID3Tag GetTag(string file)
{
string strTag = string.Empty;
ID3Tag tag = new ID3Tag();
ASCIIEncoding encoding = new ASCIIEncoding();
FileStream fs = new FileStream(file, FileMode.Open);
if(fs != null)
{
byte[] block = new byte[128];
fs.Seek(-128, SeekOrigin.End);
fs.Read(block, 0, 128);
fs.Close();
strTag = encoding.GetString(block);
if(strTag.Substring(0,3) == "TAG")
{
tag.title = strTag.Substring(3, 30);
tag.artist = strTag.Substring(33, 30);
tag.album = strTag.Substring(63, 30);
tag.year = strTag.Substring(93, 4);
tag.comment = strTag.Substring(97, 28);
if(strTag[125] == 0)
{
tag.tracknumber = strTag[126];
}
else
{
tag.tracknumber = 0;
}
tag.genre = strTag[127];
}
}
return tag;
}
HTH
- Nick Parker My Blog | My Articles
|
|
|
|
|
I didn`t have Data tab in my Toolbox. Why is this? Tried reinstall. Thanks
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
When I`m adding reference from COM, It shows error, " A reference to 'Microsoft ActiveX Data objects ............' could not be added. The type library wrapper tool 'tlbimp' connot be found on this system. Please re-install Visual Studio. "
i`ve already reinstall Visual studio, but it didn`t solve the problem. I then tried searching the tlbimp.exe, and found out it`s in C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin folder, and tried moving the file to windows system folder, and it didn`t change anything. Help please. I`m desperate. What should I do???
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|