|
There isn't much more to explain. Just create your VB class, then add a reference to it in your C# project.
|
|
|
|
|
It might have been us (Instant C#). Then again, it might have been any number of the on-line or commercial tools out there (try google).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
Hello All,
I am developing an application with DataGridView. I have provided paging for it.
What I am doing is, get the records in one main table, let the user set the page size and copy those many records to temp table. User can insert, update and delete records from using DataGridView.
Now my concern is, user is playing with temp table, whatever he does is modified into temp table. I want to reflect added, changed or deleted data into original main table. I have tried Merge() but it adds all modified data into main table and when I say adapter.Update(maintable) it gives primary key violation. Any idea or workaround
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
what happens if you call adapter.Update(temp) ?
|
|
|
|
|
Adapter.Update calls insert, update, delete in subsequent manner. Hence when I call Adapter.Update(dataTable) it throws primary key constraint failed or unique key constraints failed exception. I tried to remove some rows from main table and then again adding. But it also not working.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
hi all,
can any body tell me hw to get the hexaDecimal value of a certain number.
Also i need to know how to get the asc code of a certain character.
Best regards
|
|
|
|
|
Hello,
quiteSmart wrote: can any body tell me hw to get the hexaDecimal value of a certain number.
public string IntToHex(System.Int64 number)
{
return String.Format("{0:X}", number);
}
quiteSmart wrote: Also i need to know how to get the asc code of a certain character.
Sorry, don't know!
All the best,
Martin
|
|
|
|
|
Also i need to know how to get the asc code of a certain character.
public byte asc(char c)
{
return (byte)c ;
}
It might throw an exception for unicode characters that are not in the ascii table.
|
|
|
|
|
|
That's not too pretty. Better use System.Text.Encoding.ASCII.GetString()
Standards are great! Everybody should have one!
|
|
|
|
|
Thanks Martin
|
|
|
|
|
hi
i want my datagridVIEW rows has periodic color
for example :
row No color
0 white
1 blue
2 white
3 blue
. .
. .
. .
what can i do?
|
|
|
|
|
Example:
this.dataGridView1.Rows.Add("1");
this.dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Blue;
this.dataGridView1.Rows.Add("2");
this.dataGridView1.Rows[1].DefaultCellStyle.BackColor = Color.Red;
|
|
|
|
|
In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.).
I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime?
e.g. I have got one button on my tab page and if I click that button the back color of tab should change.
thanks,
|
|
|
|
|
Hello,
KrunalC wrote: I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.
You should stay at this solution.
At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages.
All the best,
Martin
|
|
|
|
|
Thanks for the reply.
Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.
|
|
|
|
|
Oh,
Good work!
All the best,
Martin
|
|
|
|
|
Hi
When I type turkish letters(Ğİö..) in a text box and try to pull data, it returns no row..
But when I type select command to SQL Enterprise manager and try to pull same data, it works...
My SQL command is "select * from myTable where (column1='Ğİ' COLLATE Turkish_CI_AI)
I make,
System.Threading.Thread.CurrentThread.CurrentCulture= new System.Globalization.CultureInfo("tr-TR");
in program init...
I put Language setting to form and Localizable=true
This problem only occurs on windows 2000 english, I have no problem with windows XP turkish
I hope I could explain my problem...
Thanks
|
|
|
|
|
i want to create a setup and deployemt project which creates three empty folder. and then i need the path or i say i want to access this path from my windows services. how can i do this???
|
|
|
|
|
To establish a connection from an aspx page to a word document stored in D drive.Then replace few words in document by words present in textboxes in aspx pages
Sowmya
|
|
|
|
|
Required for what? Homework assignment?
What is the point of your post? Have you encountered any problems writing this code? Do you have any specific questions?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
u shud use word interop and word application object.
|
|
|
|
|
I am new to codeproject, and relatively new to C#. Eventually i got bored of... non-saving uses... and decided i needed to save something. So i tried.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace FileMaker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
Stream myStream;
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = saveFileDialog1.OpenFile()) != null)
{
StreamWriter wText = new StreamWriter(myStream);
wText.Write("CHEESE");
myStream.Close();
}
}
}
}
}
It doesn't work. When i run the program and click on the button, and go through the save file dialog, a file does appear, but "CHEESE" does not appear in the text file. I cannot figure out why this doesn't work. So how do i fix this so that "CHEESE" appears in the file?
Thanks to anybody who helps!
|
|
|
|
|
try closing the streamwriter before closing the stream...
Luc Pattyn
|
|
|
|
|
wText.Close();
MyStream.Close();
unless u close the writer, buffered things will not be explicitly fwded to the disk.
|
|
|
|