|
Yes,combobox & listbox bound to the datasource....during page load
|
|
|
|
|
I just helped out someone who has a similar problem with data binding, try running the code without the debugger attached (Ctrl+F5), this worked for his solution for some odd reason. Alternatively you could try calling ComboBox.Refresh() to force it to redraw itself.
|
|
|
|
|
|
how i will change windows date time format? It should change the system's date time format too.
-- modified at 5:39 Wednesday 14th February, 2007
|
|
|
|
|
Format Info
DateTime objDate = DateTime.Now;<br />
String strFormatedDate = objDate.ToString("yyyy-mm-dd HH:mm:ss");
Edit:
Wrong topic? OS/SysAdmin
Anyway you can change the windows date time format in Start->Configuration Screen->Languagesettings
There you can change all currency and formats...
-- modified at 5:41 Wednesday 14th February, 2007
|
|
|
|
|
Check the registry key in regedit: HKEY_CURRENT_USER\Control Panel\International
Here are all the windows format settings stored. To edit this value's from within your program you have to use the Microsoft.Win32.Registry class.
PS. When you want to edit/update an value you need to use the method CreateSubKey and not OpenSubKey
This code will change the long date time representation of windows to DayName DayOfWeek MonthName 4-digit Year:
RegistryKey objReg = Registry.CurrentUser.CreateSubKey(@"\Control Panel\International");<br />
objReg.SetValue("sLongDate", "dddd d MMMM yyyy");
Hope this is usefull...
|
|
|
|
|
Hai all,
In my project i want to generate an excel report from datgrid...
i just want to export my contents of datagrid to excel... can anyone
help me with c# sample codings.......
with Regards,
Imthiyas Ahamed.A
|
|
|
|
|
at first you have to select the reference named:microsoft excel 10.0 object lib and microsofr office 10.0 object lib
then u may use this or some thing like this
==>
string Path = @fileName;
// initialize the Excel Application class
Excel.ApplicationClass app = new ApplicationClass();
// create the workbook object by opening the excel file.
Excel.Workbook workBook = app.Workbooks.Open(Path,0,true,5,pass1,pass2, true,
Excel.XlPlatform.xlWindows,"\t",false,false,0,true,1,0);
// get the active worksheet using sheet name or active sheet
Excel.Worksheet workSheet = (Excel.Worksheet)workBook.ActiveSheet;
// This row,column index should be changed as per your need.
// i.e. which cell in the excel you are interesting to read.
int row=2;
while ( ((Excel.Range)workSheet.Cells[row,1]).Value2 != null )
{
for(int a=1;a<=col;a++)
{
if(((Excel.Range)workSheet.Cells[row,a]).Value2 != null )
totSiz[row-2,a]= ((Excel.Range)workSheet.Cells[row,a]).Value2.ToString();
}
row++;
}
|
|
|
|
|
how can i get ipaddress into database?
String strHostName;
//= new String("");
if (args.Length == 0)
{
// Getting Ip address of local machine...
// First get the host name of local machine.
strHostName = Dns.GetHostName();
//MessageBox.Show(strHostName);
}
else
{
strHostName = args[0];
}
// Then using host name, get the IP address list..
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
strip = addr[i].ToString();
//MessageBox.Show(strip);
}
Is it proper?It is stored in 'strip' variable, which i have to call later in a function. can u get it?
How shu i declare these : args,Dns,args[0],IPHostEntry,IPAddress[] ?
thanx
|
|
|
|
|
define variabel in top of page. so it stored permanently while u'r application in running mode.
write this on top of page.(global variabel define)
if think.
public string var1;
|
|
|
|
|
|
all string?
i didn't got u'r question. send me again.
|
|
|
|
|
Perhaps this should help you...
public string strHostName="";<br />
public string [] args=null;<br />
public IPHostEntry ipEntry =null;<br />
IPAddress[] addr=null;<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
if (args.Length == 0)<br />
{<br />
strHostName = Dns.GetHostName();<br />
}<br />
else<br />
{<br />
strHostName = args[0];<br />
}<br />
<br />
ipEntry = Dns.GetHostByName(strHostName);<br />
addr = ipEntry.AddressList;<br />
for (int i = 0; i < addr.Length; i++)<br />
{<br />
strip = addr[i].ToString();<br />
}
I Love SQL
|
|
|
|
|
I have a form with a number of user controls on, however the form seems to keep corrupting. I don’t have the problem with any forms that don’t have user controls, and another dev here has the same problems on another app (different user controls as well).
This is the error that I get when I try to load the form in the designer
http://img157.imageshack.us/my.php?image=formerroruu9.jpg
Any suggestions
I am using VS 2005
-- modified at 4:55 Wednesday 14th February, 2007
|
|
|
|
|
Hello,
The designer calls the Constructor and also the setters of properties if they are set, from your usercontrol.
In your case you whant to access an object wich is not created (instanziated) yet, therefore you get this null ref Exception.
You first have to find the point in the usercontrol where the exception is thrown:
You could start a second instance of your project and then connect at youre first instance.
After that you should set a breakpoint in your controls constructor, and then open the form (designer) in the first project.
Or go threw the code and look for unsafe code (like access without a != null if statement).
Once you find your problem please don't use the "DesignMode" property (like some programers would recommend) as a workaround, make it run by changing maybe the design or use an if statement.
Hope that helps!
All the best,
Martin
|
|
|
|
|
Thanks for your reply,
Firstly can you explain how i do this i a little more detail
"You could start a second instance of your project and then connect at youre first instance.
After that you should set a breakpoint in your controls constructor, and then open the form (designer) in the first project."
secondally, one minuate that project is fine then, i rebuild it and it breaks, why would it not be consistant?
Thanks
Mark
|
|
|
|
|
|
Thanks, Have sorted my app
|
|
|
|
|
Hi friends,
I want to run sql server 2000 script (abc.sql) file from my C# application.
Can you guide me??
Regards,
Sushant Duggal.
|
|
|
|
|
read it as textfile than paste content of it in SqlDataAdapter or SqlCommand or in SqlDataSource
I Love SQL
|
|
|
|
|
I would suggest that you look at using Process.Start to run osql.exe .
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete,
Thanks for your post. Can you tell me after starting the osql process, what I need to do.
Regards,
Sushant Duggal.
|
|
|
|
|
Sushant Duggal wrote: Can you guide me??
You can run just about any SQL through a SqlCommand . Just read the file in to a string and dump the string into the SqlCommand .
NOTE: GO is not SQL. It is a preprocessor command to Query Analyzer to tell it to split the file into batches. If your file has GO s in it, you need to split it up and send them as separate SqlCommand s.
|
|
|
|
|
Thanks for the reply friends.
Regards,
Sushant Duggal.
|
|
|
|
|
<code>ResultForm.richTextBox1.Text += "Return Result # " + (beginResultPage + i + 1).ToString() + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].snippet + "\r";
ResultForm.richTextBox1.Text += gresult.resultElements[i].URL + "\r\r";
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("<b>", "");
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("</b>", "");
ResultForm.richTextBox1.Text = ResultForm.richTextBox1.Text.Replace("<br>", " ");</code>
Hi
reading from the codes above, i want to <b>bold</b> some of the results that is recieved through the richTextBox control in the form.
For eg, if i want to make bold the title that is produced using this line of code,
ResultForm.richTextBox1.Text += gresult.resultElements[i].title + "\r";
What do i need to add in to ensure that the results is in bold?
frossie
|
|
|
|